Most Common Linux Commands and Shortcuts

Written by:  • Edited by: J. F. Amprimoz
Updated Jul 6, 2011
• Related Guides: Text File | Linux

Like many newcomers to Linux, I was afraid of the command line when I first started using Linux. However, I began to realize that without the command line I wasn't exploiting my computer to the maximum. That's why it is helpful to know the most common Linux commands and shortcuts you can safely use.

Introduction

Manual Page of ls Command
click to enlarge
You are not really exploiting your Linux box to the maximum if you are not using the command line. The tasks that could take hours to perform in the graphical user interface are just a couple of seconds away if you are using the terminal. For example assume that your friend requested to know which songs you have in your music collection. Would you prefer opening up a file browser and checking each song or search string, or would you prefer to open up a terminal and type tree Music > my_music.txt, which also shows which songs are in which folder and writes them to a text file ready to e-mail? I assume you chose the latter, as it is quicker and provides a copy of said search parameters, and if so, then it pays to learn the basic Linux commands and to start using them step by step, day after day.

Commands in the Linux world are issued as command options arguments. To learn more about commands, options and arguments always consult the man (manual) page first. To read the man pages, type man command_name. The screenshot above is an example of a man page, for the ls command.

I will give links throughout the article for each command, which will take you to the article which is written on this specific one.

cp

Possibly the oldest command that lets you copy one file from one location to the other. The usage is cp folder_name/file1 /another_folder/file2 which copies the file named file1 in folder_name to file2 in another_folder.

Also note, this command string renames the file during the copying process, for example here we want to give file1 another name, i.e. file2.

To learn more about the cp command check out Jon Jermey's article Moving and Copying Linux Files.

mv

Possibly the second oldest command which allows you to move files from one location to the other. The usage is the same with cp.

ls

Another archaic command, and short for list. Yes, you are right! the ls command simply lists the contents of the particular directory you are in. For example if you are in your home folder, ls lists the home directories contents and its underlying files. However, ls does not list hidden files if there are no accompanying arguments stated. To see those files, use the -a option: ls -a.

cd

The cd command is short for change directory. It allows you to change from one directory to another. For example, if you are in your /home/user_name/Documents folder and you want to change to the /home/user_name/Music folder, you can issue cd ~/Music and change to that directory. The tilde (~) character is the shortcut for your home folder.

Showing page 1 of 2

 
blog comments powered by Disqus
Email to a friend