Categories
Command Line

Plesk basic commands

Create customer

/usr/local/psa/bin/customer --create USERNAME -passwd PASSWORD -name USERNAME

Create user

plesk bin user --create EMAIL -owner USERNAME -passwd PASSWORD -cname USERNAME -role ROLE

The role could be owner or webmaster or …

Create subscription

plesk bin subscription --create example.com -owner USERNAME -service-plan "Default Domain" -ip xx.xx.xx.xx -login USERNAME -passwd "PASSWORD"
Categories
Command Line

Log terminal commands and output

Script Method

Start

script screen.log

End

exit

Alternate method

[COMMAND] > output.txt

Appending to previous data

[COMMAND] >> output.txt
Categories
Command Line

Diff terminal command basic

Usage

diff file1.doc file2.doc

List of lines added

diff --changed-group-format='%>' --unchanged-group-format='' file1.doc file2.doc
diff -u file1.rsc file2.rsc | grep -E "^\+"

List of lines removed

diff --changed-group-format='%<' --unchanged-group-format='' file1.doc file2.doc
diff -u file1.rsc file2.rsc | grep -E "^\-"
Categories
Command Line

Basic Linux Dig commands

# dig google.com
# dig google.com +short

MX Record

# dig google.com MX

SOA Record for Domain

# dig google.com SOA

TTL

# dig google.com TTL

Get only Answers

# dig google.com +nocomments +noquestion +noauthority +noadditional +nostats

Get all DNS Records Types

# dig google.com ANY +noall +answer

DNS Reverse Look-up

dig -x 216.58.206.110 +short

Multiple DNS Records

# dig yahoo.com mx +noall +answer redhat.com ns +noall +answer

Create $HOME/.digrc to configure

Categories
Command Line

Useful Linux CLI commands

hostname -I
[root@ftp ~]# groups
[root@ftp ~]# groups root
[root@ftp ~]# grep root /etc/group

Symbolic Links

Hard Link

ln /path/to/file /path/to/hardlink

Soft Link

ln -s /path/to/file /path/to/link

To Prevent Soft Link Overwrite

ln -s -b /path/to/file /path/to/link

List all symbolic links

ls -lt

Unlink a file

unlink linkfile
grep -r SSLCertificateFile /etc/httpd
httpd -S
openssl x509 -in server.crt -noout -subject

All users:

$ getent passwd

All groups:

$ getent group

All groups with a specific user:

$ getent group | grep user

Delete user

userdel user's username

Delete including users home directory

userdel -r user's username