50 Most Common Linux Commands

Spread Some Love

Commands Mostly Used For Navigation And File Management

1: pwd

pwd stands for “Print Work directory,” and this command helps you to locate which home directory you’re currently in and ensure that you won’t get lost or overwhelmed in a terminal window. A home directory is used by a user to store and create directories, which are basically the location in the file-system.

2: ls

By using ls command, you can display the contents (files and folders) of the current or any particular directory. Not to mention, ls is also one of the frequently used commands in the Unix world.

3: cd

The cd command helps you to move around from one directory to another and browse the entire file-system without hitting a snag.

4: mkdir

To create a new folder through the terminal, you will be required to employ the mkdir command.

5. lsblk

The lsblk command displays the list of all the information related to all the block devices.

6: mount

This command is used to mount the file-system found on a device to the big tree structure rooted at ‘/‘

7: rmdir

For deleting any empty directories from the system, you can use the rmdir command. We hope you don’t get confused with mkdir and rmdir.

8: df

The df command is used for displaying the essential information about the total space and available space on the file-system. For system administrators, it’s an important command on their arsenal to monitor and analyse real-time server as well.

9: rm

The rm command is used to delete objects like file/ folders, directories, symbolic links, etc. from the file-system.

10: cp

The cp command is used to copy files, groups of files or directory from one folder to another right from the terminal.

11: mv

The mv command is used to move single or multiple files or directories from one location to another in the file system.

12: cat

The cat command is used to create, view, and concatenate multiple files. It works in a way by reading the data from a file and giving its content as an output.

13: tail

The tail command is yet another basic Linux command which is commonly used for outputting the last part of files given to it via standard input. By default, this command prints the last N number of data of the given input.

14: touch

The touch command-line is an important utility for creating a valid empty file in the terminal that you can either fill later or in real-time. You can use it to create, change, and modify timestamps of a file in a go.

15: comm

comm command is mainly used for comparing two sorted files line by line on the terminal for the common and distinct lines. It can be really helpful when you’re trying to process large amounts of files and data.

16: less

The less command can be used for reading or viewing the contents of a text file without having to interrupt the ongoing terminal session.

17: ln

The ln command is used for creating symbolic links between any specific file.

18: dd

The dd command-line utility is used for copying and converting files from one type to another.

19: cmp

If you want to compare two files byte by byte, the cmp command will help you do that. It helps to find out whether or not two files are identical and print the result to the standard output stream.

20: alias

The alias command instructs the shell to replace a word by another string in files directly from the terminal while executing the commands.

Most Common Linux Commands for Manipulation of the System

The various system commands let you dig out the essential information about your Linux system and make you more familiarise.

21: ps

The ps command is one of the handiest commands to display the list of currently running processes and PIDs by your machine.

22: service

service is a de-facto command that can be leveraged for running a System V init script.

23: kill

The kill command functions the same way as it sounds. It’s used for manually terminating the processes (without having to log-out or reboot the system) that sometimes get stuck due to resource constraints.

24: uname

uname is used for gaining the system information (name, version, and other system-specific details) about the current machine and the operating system running on it.

25: batch

batch command is used for running system services in a predefined schedule. For instance, it’s used for reading commands from standard input or a specified file and carry out them when system load levels permit.

26: shutdown

As the very name implies, the shutdown command immediately brings the machine down in the safest way.

Commonly used Linux Commands for Network Administration

Since networking is an essential part of servers, learning how to diagnose network issues is vital. With this list of Linux Network commands, we have a few in-built commands you can use in your profit when you want to troubleshoot.

27: iptables

It’s a command-line interface used for setting up and maintain tables for the Netfilter firewall for IPv4. With the help of iptables, system admins can control and monitor the incoming and outgoing internet traffic for a particular host machine.

28: wget

wget is a GNU command-line utility that is used by network admins to download files from the web without hindering the current process. Moreover, it’s non-interactive, which means it works in the background; thus, it can be used in scripts and cronjobs.

29: cURL

It’s a powerful tool that helps users in transferring data to or from a network server. The network tool, cURL is designed to work even without any user interaction; therefore, it can ideally be used in a shell script.

30: traceroute

The traceroute command is highly used by security professionals to comprehend the route that a packet takes to reach the host from one machine to another.

Most Useful Linux Commands for Search Operations

There are a few useful commands Linux has, which effectively helps in searching data and matching complex patterns for a particular file or sequence in files.

31: find

The find command helps users when searching for files and directories from the terminal to perform subsequent operations on them. It has various parameters that allow users to search file by folder, name, creation date, modification date, ownership, and file permissions.

32: which

The which command comes quite handy if you are trying to search or locate the executable file associated with the given command. It takes specific criteria and searches for the binary files in the $PATH system environment variable.

33: locate

As the very name implies, locate command is used for finding the location of a specific file by its filename. When you find yourself in doubt, implement this command to locate any particular file on your Linux machine; it’s lightening-fast.

34: grate

Yet another powerful command you can employ when searching an object or file by a specific pattern of characters inside large volumes of text files. As soon as you enter the grate command, it will display all lines that contain the searched pattern.

35: sed

Using sed command, you can find, filter, replace, substitute, or even manipulate text like insertion, deletion, etc.

Linux I/O Commands and File/ Directory Commands

Knowing how to manage Linux’s input source or output destination and file or directory ownership is always helpful.

36: clear

The clear command is used for wiping out your existing terminal screen.

37: sort

In Linux, with the help of sort command, it’s a breeze to sort out a file in an alphabetical or reverse manner and to arrange the records in a particular order.

38: echo

The echo command is used for displaying or outputting a specific text/string that is passed as an argument to the terminal console.

39: sudo

sudo stands for “superuser do” that lets non-privileged users (with proper permissions) to execute commands or access and modify files that require low-level permissions.

40: chmod

The chmod command comes into play when a user wants to change or modify the access mode/permission of system or objects files.

41: chown

Quite similar in the operation to the aforementioned command, chown lets you change the ownership of a file or group. But make sure that both chmod and chown terminal commands necessarily require root privileges to run.

Some Miscellaneous Linux Commands

Let’s talk about some everyday use commands that would help you enhance your productivity, or you may use them for fun purposes when getting bored.

42: cal

Have you ever try to access the calendar in the Linux terminal? cal command is used to see the calendar of a specific month or a whole year in an ASCII text format.

43: fortune

The fortune command-line utility is a simple program based on the fortune-mod package that displays random poignant, inspirational, sarcastic, or silly phrases from a database of quotation.

44: history

The history command is used for viewing the executed command of your previous terminal sessions.

45: yes

It’s just for fun. On entering yes command, type any text of your choice, and it will print a continuous output stream of a given string.

46: banner

Using the banner command, you can actually create your own personalised banners by printing the ASCII character string in a large letter.

47: rev

rev command takes the input from the user and writes them to the standard output by reversing the lines character wise.

48: man

You can make use of the man command to view the user manual or documentation page of any command we can run on the terminal.

49: tar

The tar command is used for creating an archive and extracting the archive files.

50: whatis

whatis offers the users to get a one-line manual page description and prints out system commands that match them.

I hope these commands give you a basic understanding and grasp of some of the many abilities that Linux has to offer. Make sure and check back soon for more Linux content.