Linux utilities are the heart and soul of the operating system. They do more than anything in a graphical environment can. For any utility you can see all of its options by using the man command with any utility. So just open a terminal and try them out. Feel free to experiment too.
Essential Linux Commands
This is a great essential Linux command. It has a lot of versatility. More importantly, though, it helps you move around in the file system. Here I did [ls] to start with so you could see where I started. Then I decided I wanted to go to my [Documents] directory. All I do then is enter the path there separated by slashes. Then I wanted to go up one folder. The way to do that is [cd ..]. That will take you up 1 directory level. I then used [ls] to see where I was. Lastly I wanted to take a look at my [Music] directory to see if I had uploaded any music yet. I had not alas.
This is a simple but useful utility. It lets you clear your current window of activity. Sometimes you might have a need to only show certain things in your terminal. This will reset you quickly. I used it several times when writing this post because I did not want my terminal to be cluttered.
This stands for manual. It is quick and easy to use. It is also the help system for Linux. It not only helps you but will give you more information that you could imagine. Any time you question how to use any utility or feature just use it with the [man] utility.
This essential Linux command displays information about files. It will work on a single file or multiples if used as an argument. There are a variety of ways to using it. It is one of the basic Linux utilities that everyone uses. Check what directory your in or what files and sub directories are available. Ls has a couple options, -a and -d . The -a option lists everything in the directory. The -d option displays the sub directories.
My favorite option is the -R. It outputs hierarchies of everything there. This is especially useful. The last option I wanted to mention is the -s one. It stands for size. It is always useful knowing the size of a file you are working with for a variety of reasons. Of course you can also combine these options using 2 or more. The files in white are data and the files in blue are directories.
This utility displays a file and its contents. It is the simplest of the utilities. Its arguments are any files you want it to join or view. There are options available depending on your needs. One of the most useful is numbering the lines.
This describes your present working directory. While there is not a lot to this utility, it can still be helpful.
This command displays the current time and date on your system. It will label the current timezone too so you know what you are getting. There are a couple options you can use but the main one is [utc]. It is used like this, date -u.
This is a handy little Linux utility. It shows the month in day form while highlighting the current day. Not much more to be said for this but when your in a hurry and do not want to close window or switch to another one this can give you the information quickly that you need. It is just a 3 letter command so it is quick.
This is a very useful and quite essential Linux command. It allows one to have superuser privileges on a case by case basis. This is important because you will generally have to think about what you are doing while using this. If you run as root all of the time then you will forget the ramifications of your actions at some point and make some drastic mistakes.
This command is what is used to remove files. You should be especially careful of this and double check. As always do not be in root to work with your system unless you have to. A single command done wrongly can wipe out multitudes of files. There are options with this Linux utility also. The -f option will force the files to be deleted even if you do not have sufficient privileges. Please be careful if you ever use it. The -r option will recursively delete directories and everything in them. This is an essential Linux command you will want to use wisely.
This is also an essential command to know. It is used to make directories. It has easy to remember syntax too which will help some. It is pretty self explanatory. It has a bunch of options so look at the manual page for them if you are curious or have a need.
This is the copy command. It’s an essential Linux command that you will use often. It will copy files or directories to whatever location you designate. There are many options available. For a full list just use [man cp] in a terminal. I will go over the ones I think are most important. The -a option is for archiving and tries to preserve permissions. The -r option is again for recursively copying directory contents over to another directory.
As you can see I did a [ls] command to show the current contents. Then I used [cp] with the -ra options to make a new file with a new name. Then I did another [ls] command to show that it did work.
This is a quite useful utility. When working in a command line environment it is sometimes harder to know what a certain file is. This command will give you details of the file argument without having to resort to using a gui. It gives important details of whatever it is. The arguments will be the file you want information of. As you can see it says whether it is text or a directory. I also showed that you can have multiple options per line. It gives a nice output in the order that you asked.
This essential Linux command is the foundational search command. It is the most useful one in my opinion so it pays to know it well in how to use it. It can search in 1 or multiple files at once. You use it to look for strings of text that will identify something you are looking for. Its first argument is the pattern you are looking for. The you direct it where to look for that pattern at. There are various options for using this.
The -c option lists all the files it finds a match in and then displays how many matches are in that file. This is useful for relevancy. The -color option will output any matches in color on your screen to make it easier to see what has been found. The -w option will look for any word that you use as an argument. This is also very useful.
This essential Linux command is used for extracting or packing files. Many times when you download something off the internet it will be in a version like this. Just use this utility to unpack it.
This is a very useful Linux utility. It will give you the amount of free disk space on your system. Quite useful for monitoring how fast your hard drive is filling up. it gives some very nice information. It is always a good idea to watch this.
This little command shuts everything down and will restart your system. It is certainly quicker than using a mouse to go through a menu.
This command is how you print from the command line. It works by sending the file to be printed to the print queue. It is done this way so other users on the system can print as well. The queue then just prints in the order it gets the requests from. The arguments are the path names or just a file to be printed if it is from the current directory. Various options are available. The -r option will remove a file to be printed. The -#n option will print however many copies that you designate.
The move command does what it says. It will move a file to another location. Be careful as this can delete files and you will lose their contents if done wrong. The arguments of this Linux utility are the path and filenames to be moved and location to where they are to moved to. The most useful option here is the -i option because it will ask you to confirm when overwriting a file.
The sort utility is very useful when looking at a list of directories or files. You can use it to sort and merge files. Its arguments are the file or files to sorted or merged. There are options, of course, but if used without any options then it will sort alphabetically. To merge, just use the 2 things to merge as arguments and their contents will be merged and sorted. The -n option will sort in numeric order if you have a list of numbers somewhere.
Another useful option is the -o option with an argument of a filename to be created and the information stored into. It will not send to your screen then but to a file that you designate. The -r option will sort in reverse. It works with either non-numeric or numeric characters. This is a very useful command if you have any data that needs to be sorted. It is a very useful Linux utility.
The tail Linux utility will output the last 10 lines of a file to your screen. This is useful when you need to quickly know the contents of a configuration file. The best option it has is for adjusting how many lines you want it to count. The default is 10 but if you use -8 and then your filename then it will output the last 8 lines of your file. In this example I was curious about what this log file was about.
If you have ever opened up a big log file before then you will know what I mean. It can take forever to get to the end or even the middle of the file. That is where this essential linux command comes in handy. As you can see I just asked for the last 20 lines. It saved me a bunch of time. It is truly an essential Linux command.
This utility I wanted to mention is the word count command. It is a great Linux command. It is very useful for outputting information about a file. It does more than just words of course. It can count lines and size as well. This is all very interesting too. Without any options it will put on screen the number of lines, words, and bytes in a file. Its arguments are the file or files to be analyzed.
It can do multiple at once and then analyze both at once. Its options are ways of controlling its output. The -l option will only show the number of lines in a file. The -m option will show only the bytes. Lastly, the -w option will show only the number of words in that particular file. As you can see I analyzed [alpha] and [small_file]. It then gave me a total between the 2 files.
The Linux file system has many processes running at once. It is these processes that allow you to do things useful on your computer. You can see i do not have a lot running right now. Most of you will be using more at once than I am now. Pay attention to that [PID] number. That is how you identify any process.
This is a very useful Linux utility. It goes well with the above mentioned [Ps] command. If you ever get a process that is not responding or that you just need to get rid of then use the [Kill (PID number)]. As you can see above everything has a PID number. If something is not working correctly then you can use this command to end it.
This is how you change permissions. Linux has a very flexible permission system. It is good to understand what is happening even if you are just a user. This command deserves its own article soon. That is how in depth and valuable it is. I will get an updated version up soon.
This goes right with [Chmod] as it is used to change the ownership of a file.
This is a list of the utilities that I find the most useful. There are many other ones of course and soon I will try to cover more of them. If you know these though they will give you a great start in learning how to navigate and control the various processes that you do on a daily basis in any Linux system. For more information on any particular command you can use the man page for that utility.