These are a list of the most commonly used linux commands
Command | Description |
---|---|
ls | It is a list command and will display the directories and files visible under the present working directory |
ls -R | Goes a step further to display or list files in sub-directories of the present working directory |
ls -a | The argument -a in this list command helps list all the hidden files in the present working directory |
ls -al | The argument -al in this list command gives a detailed list of the displayed files and directories with extra information such as size, permission, owner, etc. |
cd or cd ~ | Takes you to the Home directory of your Linux operating system |
cd .. | navigates you backwards to the parent directory of the current directory you are under. |
cd | combine it with a target directory under the present working directory to navigate to it e.g cd Downloads |
cd / | Takes you to the root directory of your Linux operating system |
cat > filename | It will create a file called filename |
cat filename | It will display the contents of a file called filename |
cat file_1 file_2 > file_3 | Joins the content of file_1 and file_2 and copies the result to a newly created file_3 |
mv file_random “defined file path” | It will move the file called file_random to the target file path or destination you will define. |
mv file_name new_filename | It will rename the file called file_name to a new file name called new_filename |
sudo | A command used by sudoer users to execute privileged commands applicable to a root user or superuser. |
rm filename | It will delete a file called filename |
man | Use it with a Linux command you do not understand to get help on how to use it. E.g man sudo |
history | It will display a list of the previous Linux terminal commands you have executed under that specific session. |
clear | It will clear your command-line interface if you feel it is too crowded. |
mkdir directory_name | it will create a director called directory_name |
rmdir my_directory | It will delete a directory called my_directory |
mv | You can use it to rename a directory or a file |
pr -x | It will divide or split a file to x defined columns. |
pr -h | Use it to add a header to a target file. |
pr -n | Uses Line numbers to denote a target user file. |
lp -nc, lpr c | It is a printing function and in this case it will print c copies of a target file. |
lp -d lp -P | Helps you identify the name of the printer you are using. |
apt or apt-get | A Debian distro package command for installing system updates and package applications |
mail -s ‘mail_subject’ -c ‘cc-mail_address’ -b ‘bcc-mail_address’ ‘to-mail_address’ | Use this command to send an email from the terminal. |
mail -s “mail_subject” to-mail_address < attachment_filename | Use this command to also send an email from the terminal but this time with an attachment. |