Below mentioned commands are most commonly used shell commands in Linux.
Sudo : This command allows a permitted user to execute a command as the superuser. It allows users to run programs with the security privileges of another user.
ls: This command lists all the files/directories in a directory.
ls -al: This shows all files, directories, and details attributes for each file.
cd: This is used to change the directory.
cd ~: This is used to enter home directory
cd -: This takes you to the last directory you were in
cd .. : go up a directory
cat: This prints the file contents to the screen.
tail: This is same as cat command but only reads the end of the file.
tail /var/log/messages: This is used to see the last 20 lines of /var/log/messages
tail -200 /var/log/messages: This is used to print the last 200 lines of the file to the screen.
vi: This is a text editor that allows a user to control the system by solely using the keyboard
vi /home/burst/public_html/index.html: This is used to edit the index page for the user's website.
grep: Grep searches files for a given character string or pattern and can replace the string with another. This is one method of searching for files within Linux
grep root /etc/passwd: This shows all matches of root in /etc/passwd
grep -v root /etc/passwd : shows all the lines that do not match root.
touch: touch command creates a blank file, only if it doesn’t exist.
touch /home/burst/public_html/404.html : This creates an empty file called 404.html in the directory /home/burst/public_html/
ln : This creates link between files and directories. The ln command creates a new name for a file through hard linking, allowing multiple users to share one file.
ln -s /usr/local/apache/conf/httpd.conf /etc/httpd.conf: Using this command you can edit /etc/httpd.conf rather than the original. changes will affect the original, however you can delete the link and it will not delete the original.
rm: This is used to delete a file
last: This shows who logged in and when
last -20 -a: This shows last 20 logins, with the hostname in the last field
netstat: shows all current network connections.
netstat -an: This shows all connections to the server, the source and destination ips and ports.
du: This shows disk usage
du -sh: shows a summary, in human-readable form, of total disk space used in the current directory, including subdirectories.
wc -l filename.txt: This will show how many lines are in filename.txt
chmod: This command changes the file permission of each given file, folder etc
eg: chmod 755 file1
getfacl: check the permission
eg: getfacl file1
chown: change file owner and group
df: df displays the amount of disk space available on the file system
tar: Tape Archive is useful in creation of archive, in a number of file format and their extraction.
nslookup: Nslookup allows a user to enter a host name and find the corresponding IP address.
cron- CRON is a Linux system process that will execute a program at a preset time.
wget: wget is a network utility that retrieves files from the web that support http, https and ftp protocols.