100 Essential Linux Commands for Every User

100 Essential Linux Commands for Every User
Normal Linux user knows almost all the basic Linux day-to-day use commands to perform basic task such as installing any application, copying files from one directory to another, etc. But in this article I’m going to list 100 essential Linux commands which can be useful for every Linux user right from the noobs to the professional Linux developers and system administrators.So before wasting any time let’s get started with this huge list of essential Linux commands.

1. Cat (Concatenate)

This command can be used to get the contents of the file as an output in the Terminal window. You just need to write the cat command as shown sample screenshot and execute it.

As the name suggests this command can be used to create, view and concatenate files.

If the file is longer than the size of Terminal window then it will be not easy to read or view all the content of the file easily. But there is a tweak, you can use less with cat command. It will give user an ability to scroll forward and backward through the content of the files using PgUp and PgDn keys or Up and Down Arrow keys on the keyboard.

Finally to quit from the less you can just type in q.

2. aptitude

aptitude is highly powerful interface for Linux package management system.

First of all you need to install or update aptitude package in your system using following command.

Once the installation is complete you can type aptitude in Terminal and execute it, this will open up aptitude interface as you can see in screenshot below.

You can use this aptitude built-in interface to update, install or remove any application package on Linux or its other distributions.

3. cal

You can use cal command in Terminal window to see the calendar, as you can see in the following screenshot I have executed command to view the calendar of the current month and you can notice it highlighted the date as well.

You can also view the calendar of an entire year by executing command shown in following screen shot.

4. bc

bc is another cool and useful command for Linux users as it allows you to enable command line calculator in Linux Terminal when you execude following command.

You can make any calculation in Terminal window itself, isn’t that cool command to have at your service?

5. chage

The Linux command chage is an acronym for change age and it can be used to change the expiry information of the user’s password.

As you can see in the above screenshot you can also force the user to change the password after certain period of time i.e. periodically. This is an excellent command for system administrators.

6. df

You can get all the information of your file system just by executing df command in the Terminal window.

If you use df –h it will display file system information in human readable format as you can notice in following screenshot.

7. help

When you execute this help command in Terminal window, it will list all built-in commands you can use in shell.

8. pwd (Print Work Directory)

As the name Print Work Directory suggests, this command the path of the directory currently you’re working in. This command is very useful for all the Linux noobs and those who are new to Linux Terminal.

9. ls

I think I don’t need to introduce to this command as this is one of the commonly used commands in Terminal by Linux users.

When you type and execute ls command in Terminal, it will show you all the contents of the particular directory i.e. both files as well as directories as you can see in above screenshot.

10. factor

factor is a mathematical command  for Linux terminal which will give you all the possible factors of the decimal number you enter in the shell.

11. uname

uname is another useful Linux command to have as it displays Linux system information when executed in Terminal shell.

To view all system information type uname -a in Terminal.

For information related to kernel release only just type in uname -r.

And for operating system information type uname -o in Terminal shell.12. ping

If you want to check if your system is connected to router or internet then PING (Packet INternet Groper) is the command for you. It uses ICMP protocol to connect to other devices.

There are several options to use with ping command, ping displays addresses as host name so if you want to view them in numbers then use ping -n command. Ping -I to specify the interval between transmissions as it is 1 second by default.

13. mkdir

mkdir <file name> command can be used to create a new folder in any directory using Linux Terminal. You can see in the following screenshot that I have created VGPM folder using mkdir command in Terminal shell.

You can also use rmdir <file name> command to remove any folder in the directory right from your Linux Terminal window.

14. gzip

You can compress any file from Terminal window using gzip <file name> command but it will remove original file from the directory. If you wish to keep the original file then use gzip -k <file name> instead as it will keep both original as well as new compressed file in the directory.

15. whatis

If you wish to know for what the particular Linux command can be used for then just execute the command whatis <command name> in Terminal shell and it will show you short one line description of that particular Linux command.

16. who

This one is for system administrators who handle and manage various users on Linux system. who command when executed in Terminal show the complete list of those users who are currently logged into Linux system.

17. free

free command can be used to check exactly what amount of storage is free and used in physical as well as swap memory in the system.

There are also some options to use with free command such as you can use free -b to view the results in bytes, free -k to display the available and used in memory in kilobytes, free -m to to view in megabytes, free -g to view results in gigabytes and free –tera to view the results in terabytes.

18. top

top is simple but useful command to monitor all the ongoing processes on the Linux system with the user name, priority level, unique process id and shared memory by each task.

19. sl

This one is just for bit fun during the work and not a useful command. When executed a steam engine passes through Terminal window. You can try it for fun!

If you are unable to see it then use the following command to install it.

$ sudo apt install sl

20. banner

banner is another fun command for Linux Terminal when executed with banner <your text> will display whatever text you type will be displayed in big banner format as you can see in following screenshot.

$ sudo apt-get install banner

21. aafire

How about putting the Terminal window on fire? Just fire the command aafire in the Terminal window and see the magic.

$ sudo apt-get install libaa-bin

22. echo

echo command can be used to print any text you through with the command as you can see in the below screenshot.

23. finger

finger <user name> will display all the information about any user on the system such as last login of the user, home directory of the user and full name of the user account.

24. groups

If you want to know which groups the particular user is member of then execute groups <user name> command in Terminal window. It will show entire list of the groups a user is member of.

25. head

This command will list the first 10 lines of the file you through with head command in the Terminal window. If you want to see particular number of lines then use -n (number) option like head -n (any number) <file name> in Terminal shell just like I did in following case.

26. man

Here man stands for user manual and as the name suggests man <command name> will display the user manual for the particular command. It will display name of the command, ways in which command can be used and description of the command.

27. passwd

You can use passwd command to change the password for self or any user, just through the command passwd if you want to change password for youself and passwd <user name> if you want to change password for particular user.

28. w

w is the short and simple command which will help you view the list of currently logged in users.

29. whoami

This command will help you to find out which user is logged into system or who you are logged in as.

30. history

When fired into Terminal shell, history command will list all the commands used by you in serial numbered form. Using exclamation mark ! and serial number of the command will help you execute that particular command without need to writing whole command in the terminal.

31. login

If you want to switch user or want to create new session then fire this command in Terminal window and provide the details like login id and password as shown in screenshot below.

32. lscpu

This command will display all the CPU architecture information such as threads, sockets, cores and CPU count.

33. mv

mv (move) command can be used to move one file or directory to another file or directory. It is very useful command especially when you’re working on system administration.

34.ps

If you want to see the list of processes that are currently running for your session or for other users on the system then ps command is for you as it shows processes with their process identification numbers and in detail as well when you use ps -u command.

35. kill

You can use this command to kill the currently ongoing processes manually form the Terminal shell itself. You need unique PID i.e. process identification number to kill the process.

36. tail

tail <file name> command will display last 10 lines of the file in the Terminal window as an output. There is an option to last specific number of lines as you want with the command tail -n <number of lines> <file name> as shown in screenshot below.

37. cksum

cksum is a command to generate the checksum value for the file or stream of data thrown with command in Linux Terminal. You can also whether the download is corrupted or not if you are facing problem in running it.

38. cmp

If you ever need to do byte-by-byte comparison of the two files then cmp <file name 1> <file name 2> is the best Linux command for you.

39. env

env is a very useful shell command which can be used to display all the environment variable in the Linux Terminal window or running another task or program in custom environment without need to make any modifications in current session.

40. hostname

hostname command can be used to view the current host name and hostname <new name> can be used to change the current host name to new one.

41. hwclock

You can use hwclock or hwclock –set –date <DD/MM/YYYY> command to view hardware clock or set it to new date.

42. lshw

sudo lshw command can be used to invoke detailed hardware information of the system on which Linux is running. It gives you every small detail about hardware, just try it.

43. nano

nano is Linux command-line text editor just similar to Pico editor which many of you might have used for programming and other purposes. It is quite useful text editor with lots of features.

44. rm

rm <file name> command can be used to remove any file from the working directory. For better convenience you can use rm -i <file name> command as it will first ask for your confirmation before removing the file.

45. ifconfig

ifconfig is another useful Linux command which can be used to configure network interface on the system.

46. clear

clear is simple command for Linux Terminal shell, when executed it will clear the Terminal window for fresh start.

47. su

su <username> command can be used to switch to another account right from the Linux Terminal window.

48. wget

wget <file path> is very useful command to download any file from the internet and best part is download works in background so that you can continue working on your task.

49. yes

yes “your text” command is used to display a text message entered with yes command repeatedly on Terminal window until you stop it using CTRL + c keyboard shortcut.

50. last

When executed last command will display the list of last logged in users into the system as an output in Linux Terminal.

51. locate

locate command is an reliable and arguably better alternative to find command to locate any file on the system.

52.iostat

If you ever need to monitor system input/output devices then iostat command can be very useful for you as it displays all the stats of the CPU as well as I/O devices in Terminal window itself.

53. kmod

You can use kmod list command to manage all the Linux Kernel modules as this command will display all the currently loaded modules on the system.

54. lsusb

lsusb command will show information about all the USB buses connected to the hardware and external USB devices connected to them as you can see in screenshot below.

55. pstree

pstree command displays all the currently running processes in the tree format on Linux Terminal window.

56. sudo

If you need to run any command as a root user or root permissions then just add sudo at the start of any command.

57. apt

apt (Advanced Package Tool) is Linux command which helps user to interact with the packaging system as you can see in following screenshot.

58. zip

You can use zip command to compress one or more files as you can see in the screenshot below. It is simple but useful command to compress any number of files in a go.

59. unzip

To extract files from compressed zip file use unzip <file name> command in Terminal shell. You can also use this command to extract files from multiple compressed files from the particular directory.

60. shutdown

You can use shutdown command to turn of the system directly from Terminal shell. This command will shutdown the system exactly one minute after being executed. You can use shutdown -c command to cancel shutdown.

61. dir

dir (directory) command can be used to view the list of all directories and folders present in current working directory.

62. cd

cd command helps you to access particular directory or folder from the file system. You can also use cd .. command to go back to root.

63. reboot

As the name suggests you can use reboot command to restart or shutdown the system from the Terminal window. There are several options available with this command as you can see in following screenshot.

64. sort

sort <file name> command will help you sort file or arrange any record in particular order generally according to their ASCII values.

65. tac

tac <file name> command will display the contents of the file in reverse orders as you can see in below screenshot.

66. exit

exit command can be used to close the Terminal shell window directly from the command-line.

67. ionice

ionice command will help you get or set I/O scheduling class and priority for the particular process.

68. diff

diff <file name1> <file name2> command will compare the two directories and will display difference between them as shown in following screenshot.

69. dmidecode

There are many commands available for Linux to retrieve hardware information but if you want information of a particular hardware component then dmidecode is the command for you. It offers various options and you can view them using dmidecode –help.

70. expr

If you want to perform quick calculations during your work then expr is really useful command for you. You can do calculations as shown in below screenshots with more options.

71. gunzip

gunzip <filename> command can be used to extract or restore files compressed with gzip command.

72. hostnamectl

hostnamectl command can be used to access system information, change the system hostname and other related settings.

73. iptable

iptables is a simple Linux Terminal based firewall tool which helps manage both incoming and outgoing traffic using tables.

74. killall

killall <process name> command will kill all the programs matching the processes name thrown with the killall command.

75. netstat

This command is for those who need to monitor incoming and outgoing network connections continuously. netstat command displays the network status, routing tables and interface statistics.

76. lsof

lsof command will help you view all the open file related to your application in the Linux Terminal window itself. There are several options to customize the output and you can see the whole list in the below screenshot.

77. bzip2

You can use bzip2 <file name> command in the Terminal window to compress any file to .bz2 file and use bzip2 -d <compressed file name> command to extract the files from compressed file.

78. service

service command will display results of System V init scripts in the Terminal window. You can view the status of particular service or all the services as shown in below screenshot.

79. vmstat

vmstat command will display systems virtual memory usage on Terminal window.

80. mpstat

When executed mpstat command will display all the information about CPU utilization and performance stats on Linux Terminal window.

81. usermod

If you want edit or modify attributes of already created user account then usermod <options> login is the best command for you.

 82. touch

Using touch command in Terminal window you can create empty files in file system and you can also change time and date i.e. is timestamp of recently accessed files as well as directories.

83. uniq

uniq is a standard Linux Terminal command when thrown with file, filters the repeated lines in the file.

84. wc

wc command reads the file thrown with the command and displays word and line count of the file.

85.pmap

pmap <pid> command display the memory map of the pid you provide. You can also view memory map for multiple processes.

86. rpm

rpm -i <package name>.rpm command can be used to install rpm based packages on Linux. To remove rpm package use rpm -e <package name> command in Terminal shell.

87. ssh

ssh acronym for Secure Shell is protocol which is used to securely connect to host system. ssh username@host<IP/Domain Name> is the command to connect to host computer as a user.

88. telnet

telnet command uses telnet protocol to connect to another system as a user.

89. nice

If you need to change the priority of the running processes then run nice [OPTION] [COMMAND [ARG]…] in the Linux Terminal.

90. nproc

nproc [option] command will display the number of processing units allotted to the currently running process.

91. scp

scp acronym for Secure Copy is the Linux command which can be used to copy files and directories between hosts on the network.

92. sleep

sleep <Number> command will delay or pause the execution of command for particular amount of time i.e. specified with sleep command.

93. split

If you need to breakdown large file into small file then use split [option].. [file [prefix]] command in the Linux Terminal.

94. stat

You can view the status of a file or an entire file system using stat <file or file system name> command in Linux Terminal. You can also use other options as listed in the screenshot.

95. lsblk

lsblk command reads the sysfs filesystem and displays the block device information on the Terminal window.

96.hdparm

Using hdparm command you can handle hard disk and other disk devices in the Linux using Terminal shell.

97. chrt

chrt [option] priority [argument..] command is used for manipulating the real-time attributes of the process.

98. useradd

useradd [optaons] login command will help you add user account into your system

99. userdel

userdel [option] login command will let you delete any user account from the system.

100. usermod

Using usermod [options] login command you can modify any user account present on the system.

So these are the 100 essential Linux commands which can be useful for any regular as well as pro Linux user. Feel free to share your views and suggestions at @LinuxHint and @SwapTirthakar.

Related Posts
Leave a Reply

Your email address will not be published.Required fields are marked *