Using the Linux Command Line - LINUX: Easy Linux For Beginners, Your Step-By-Step Guide to Learning The Linux Operating System and Command Line (2015)

LINUX: Easy Linux For Beginners, Your Step-By-Step Guide to Learning The Linux Operating System and Command Line (2015)

Chapter Seven: Using the Linux Command Line

In Chapter Four, we discussed about the Linux Command Line or the terminal and how you can access it from your desktop. In the previous chapters, you were also able to use simple commands on the terminal. Each GUI action has a command-line equivalent. In this chapter, we will talk more about the different commands that you can use in Linux and also study the different shell features.

Using the Shell Features

You have now seen the capabilities of using the Bash shell. Performing tasks on the command line take lesser time than doing it in the GUI. To further enjoy the convenience of using the CLI (command line interface), here are some shell features that you should use:

· Command Completion

Launch a terminal and try typing an unfinished command.

For example, type the word below and press the Tab key.


Notice that Linux will automatically complete the word to formuname. Next, remove the rest of the letters and just leave the letteru, Linux will then display all the list of commands that start with the letter ‘u’. This feature makes it even faster for a user to type commands. You can even do this for filenames or directory names too. Type the first few letters of the filename and Linux will do the rest for you.

This is also helpful when you are trying to remember a command since Linux will list out all the commands starting with the letters that you put in. Combine this functionality with man and you should be able to locate the command that you are looking for.

· Command History

Linux makes it easier for users too with the command history feature. The system remembers commands you have recently typed in so you no longer need to retype. Simply use the arrow keys to view previous commands.

Here are some of the techniques that you can use to make the most out of this feature:

Keys to Use

What it does

Arrow Up/Down

Display the previous commands from the more recent going to the oldest entered

Arrow Right/Left

Moves the cursor one character to the right/left

CTRL key + A

Transfers cursor to the beginning of the line

CTRL key + E

Transfers cursor to the end of the line

Delete key

The character under the cursor is deleted


The character to the left of the cursor is removed

CTRL key + R

Search for a particular command from the command history. After you use CTRL key + R, type the first few letters of the command that you want to use

Table 9: Command Line History Shortcuts

System administrators make good use of these features because it makes admin tasks easier and faster to complete. Try the techniques on some of the commands you’ve learned and see how cool it is to work using the command line.

Essential Linux Commands

As a new Linux enthusiast, you can perform many of the tasks using the GUI. However, if you do fancy learning more commands that you can use in the shell prompt, here’s a cheat sheet of the most important Linux commands.


What it Does

Help Commands


Shows online information about a command


Shows details of a command


Shows a short description of a specific keyword


Shows the location of a command file


Assign a command alias – especially useful for long commands


Remove command alias

Managing Files and Directories


Change directory


Displays the current directory


Create links to files and directories


To trigger a file stamp update for a file

Finding Files


Search for a file based on name


Search for executable files


Search for files in the directories part of the PATH variable

Processing Files


Copy lines of data


Display the results of comparing two files


Show a text file one page at a time – display can only go forward


Show a text file one page at a time – display can only go forward and backwards


Display the count of the number of characters, words, and lines in a file


Show a text file in one output


Get sections of text in a file


Display results of finding expressions in a file


Perform editing commands then copy to a standard output


Specify a size to break a file into


Arrange the lines in a file


Keep unique lines in a file and delete duplicates

Compressing a File


Use to compress a file


If a file was compressed with a compress command, use this to decompress


Use GNU Zip to decompress files


Compress files with GNU Zip


Archive files with one or more directories

Date and Time


Show the calendar for the specified month or year


Show/Set the current date and time

Managing Processes


Run a program or a process in the background


Check for the free memory


Stop a process


Run a program with a low priority


Show current running processes


Show list of CPU and memory utilization of processes


Restart the computer


Turn off computer

Table 10: List of Important Linux Commands

Now, try out the commands above. If you are unsure of how to use the options for the commands, use the help commands (especially man and info) to find out more.


In this chapter, I gave you a list of commands and techniques that you can try in the command line. Continue on practicing with these commands and to research more online. In the succeeding chapter, we will learn about securing your operating system.