Useful Linux Commands that you should know

If you are Linux system administrator or just a Linux enthusiast/lover, than you love & use command line aks CLI. Until some years ago majority of Linux work was accomplished using CLI only & even there are some limitations to GUI . Though there are plenty of Linux distributions that can complete tasks with GUI but still learning CLI is major part of mastering Linux.

To this effect, we present you list of useful Linux commands that you should know.

Note:- There is no definite order to all these commands & all of these commands are equally important to learn & master in order to excel in Linux administration. One more thing, we have only used some of the options for each command for an example, you can refer to ‘man pages’ for complete list of options for each command.

1- top command

‘top’ command displays the real time summary/information of our system. It also displays the processes and all the threads that are running & are being managed by the system kernel.

Information provided by top command includes uptime, number of users, Load average, running/sleeping/zombie processes, CPU usage in percentage based on users/system etc, system memory free & used, swap memory etc.

To use top command, open terminal & execute the comamnd,

$ top

To exit out the command, either press ‘q’ or ‘ctrl+c’.

2- free command

‘free’ command is used to specifically used to get the information about system memory or RAM. With this command we can get information regarding physical memory, swap memory as well as system buffers. It provided amount of total, free & used memory available on the system.

To use this utility, execute following command in terminal

$ free

It will present all the data in kb or kilobytes, for megabytes use options ‘-m’ & ‘-g ‘ for gb.

3- cp command

‘cp’ or copy command is used to copy files among the folders. Syntax for using ‘cp’ command is,

$ cp source destination

4- cd command

‘cd’ command is used for changing directory . We can switch among directories using cd command.

To use it, execute

$ cd directory_location

5- ifconfig

‘Ifconfig’ is very important utility for viewing & configuring network information on Linux machine.

To use it, execute

$ ifconfig

This will present the network information of all the networking devices on the system. There are number of options that can be used with ‘ifconfig’ for configuration, in fact they are some many options that we have created a separate article for it (Read it here || IFCONFIG command : Learn with some examples ).

6- crontab command

‘Crontab’ is another important utility that is used schedule a job on Linux system. With crontab, we can make sure that a command or a script is executed at the pre-defined time. To create a cron job, run

15- locate command

‘locate’ command is used to locate files & folders on your Linux machines. To use it, run

$ locate file_name

16- grep command

‘grep’ command another very important command that a Linux administrator should know. It comes especially handy when we want to grab a keyword or multiple keywords from a file. Syntax for using it is,

$ grep ‘pattern’ file.txt

It will search for ‘pattern’ in the file ‘file.txt’ and produce the output on the screen. We can also redirect the output to another file,

$ grep ‘pattern’ file.txt > newfile.txt

17- ps command

‘ps’ command is especially used to get the process id of a running process. To get information of all the processes, run

$ ps -ef

To get information regarding a single process, executed

$ ps -ef | grep java

18- kill command

‘kill’ command is used to kill a running process. To kill a process we will need its process id, which we can get using above ‘ps’ command. To kill a process, run

$ kill -9 process_id

19- ls command

‘ls’ command is used list all the files in a directory. To use it, execute

$ ls

20- mkdir command

To create a directory in Linux machine, we use command ‘mkdir’. Syntax for using ‘mkdir’ is

$ mkdir new_dir

These were some of the useful linux commands that every System Admin should know, we will soon be sharing another list of some more important commands that you should know being a Linux lover. You can also leave your suggestions and queries in the comment box below.

If you think we have helped you or just want to support us, please consider these :-

3 Responses

It’s less a command and more a utility but midnight commander (mc), is one helluva tool worth knowing. It brings a pseudo-graphical and familiar interface (twin pane file manager) to the command line. It brings together many of the functions of these tools you’ve listed plus more. Want to peak into the contents of a zip/tar/tgz/deb file without opening it? Done. Want to visually mark files to be deleted or moved into the opposite directory. Done. (With file counts, total bytes, and file globbing for file selection). Done. Want to remotely mount another file system as one of the directory panes using sft or smb (with compilation tweaks). Done.