30 Essential Linux Commands That Every User Should Know

linux commands


Based on the Linux Kernel, the Linux operating system family is an open-source group of Unix systems. It includes popular distributions such as Ubuntu, Fedora, Debian, openSUSE, and Red Hat. One of the common uses of Linux is managing Virtual Private Servers (VPS).

When using Linux, you need to use a shell, which is a program that provides access to the operating system’s services. The shell allows you to interact with the operating system through linux commands and scripts, making it a powerful tool for system administration.

Most Linux distributions provide a graphical user interface (GUI) by default, making it easier for beginners to start with Linux. The GUI visualises the operating system and allows users to interact with it through menus and buttons, similar to other operating systems.

However, many experienced Linux users prefer to use the command line interface (CLI) to interact with the operating system. The CLI allows for greater control and flexibility, enabling users to automate tasks, write scripts, and perform complex operations efficiently.

Overall, Linux is a versatile and powerful operating system that can be used for various applications, from running web servers and databases to scientific computing and artificial intelligence. Its open-source nature and a large community of developers make it a popular choice for many organisations and individuals looking for a reliable and customisable operating system.

Linux has two primary interfaces: the graphical user interface (GUI) and the command-line interface (CLI). While both interfaces have their merits, we highly recommend utilising the CLI because it offers more control and is generally quicker. In fact, tasks requiring multiple steps on the GUI can often be completed in seconds by entering commands into the CLI.

If you’re new to Linux, you must learn the common utilities or commands to help you navigate and use your Linux distribution effectively. In this article, we’ll discuss the 40 basic commands every Linux user should know to get started. By familiarising yourself with these essential commands, you can perform a wide range of tasks quickly and efficiently.

Learning Linux Commands: Tips and Tricks for Effective Navigation

Top 25 Linux Commands for Beginners | All About Testing

Linux commands are programs or utilities designed to run on the Command-Line Interface (CLI). The CLI is a console that allows users to interact with the system via texts and processes. It is similar to the Command Prompt application in Windows.

To execute Linux commands, you need to use the terminal and press Enter at the end of the command line. The terminal allows you to run various commands that perform tasks like package installation, user management, and file manipulation.

Overall, Linux commands are powerful tools that allow users to efficiently manage and customise their Linux systems through the CLI. Users can streamline their workflow and fully utilise the Linux operating system’s capabilities by learning to use these commands.

When working with Linux commands, it’s helpful to understand their general syntax. A typical Linux command consists of three parts: CommandName, option(s), and parameter(s).

The CommandName specifies the task you want the command to perform, and it’s the primary rule that governs the action you want to take.

An option or flag modifies the command’s behaviour or operation, and it’s optional and not necessary for some commands to function. Using hyphens (-) or double hyphens (-) to invoke an option or flag.

A parameter or argument provides the necessary information for the command to execute. Like options, parameters are not required for every command.

It’s essential to remember that Linux commands are case-sensitive. Therefore, ensure you use the correct syntax and casing when entering commands in the terminal.

Essential Linux Commands: The Top 30 Every User Should Know

The Essential Linux Commands Every User Should Know - karacay.art

30. Enhancing Your Linux Skills with Sudo Command

Sudo, short for superuser do, is one of the most popular basic Linux commands that allow users to perform tasks that require administrative or root permissions. When using sudo, the Linux system prompts users to authenticate themselves with a password. This authentication process ensures the user has the necessary permissions to complete the requested task.

 A timestamp is logged by the Linux system as a tracker once the user has provided the required credentials. Users don’t need to submit their password each time they run a sudo command during this time period because every root user has the ability to perform sudo commands by default for 15 minutes every session.

However, if a user tries to run a sudo command in the command line without authenticating themselves, the system will log the activity as a security event. This feature helps to ensure that only authorised users can perform administrative tasks on the system.

The general syntax for sudo is to type “sudo” followed by the desired command. Additionally, users can add options to the sudo command, such as “-k” or “–reset-timestamp”, which invalidates the timestamp file. Additional choices include “-g” or “—group=group,” which executes instructions as the name or ID of a specified group, and “-h” or “—host=host,” which executes commands on the specified host.

30 Basic Linux Commands For Beginners [Linux 101]

29. The Power of cd Command: Navigating Your File System

The “cd” command is essential for navigation when working with Linux files and directories. This command allows users to move between different directories and access their files.

To use the “cd” command, specify the target directory you want to access. Depending on your current working directory, you can use the full path or the directory name. You will be taken to the home folder if you run the command without any options. It’s crucial to remember that this command can only be run by users with sudo access.

For instance, if you are currently in /home/username/Documents and want to access the subdirectory “Photos,” you can enter “cd Photos” to do so. To change to a new directory, such as /home/username/Movies, that is completely different, you must use the “cd” command along with the directory’s absolute path. In contrast, for other directory changes, you may not need to specify the full path.:

cd /home/username/Movies

To help users navigate more efficiently, there are some shortcuts available:

“cd ~[username]” takes you to another user’s home directory.

“cd ..” moves one directory up.

“cd-” moves to your previous directory.

By using these shortcuts along with the “cd” command, users can quickly move between different directories and access the files they need.

28. The PWD Command: File System Navigation

You can use the pwd command to determine the path to your current working directory. Just typing pwd will return the complete current path, which is a path that includes all directories and begins with a forward slash (/). A full current route would be something like /home/username.

The pwd command follows the following syntax: pwd [option]. It has two acceptable options that you can use to customise the output.

The first option is -L or –logical, which prints environment variable content, including symbolic links. If you need to view the symbolic link’s path instead of the actual path, utilising this option would be helpful.

The second choice, -P or —physical, prints the actual path to the directory that is now open. When working with directories that contain symbolic links, this option is extremely helpful because it allows you to view the physical path.

Using the pwd command with either of these options allows you to retrieve the current path of your working directory and customise the output based on your needs.

27. Is command

The ls command is a frequently used command in Linux that lists the files and directories within a system. When running the command without any flags or parameters, it displays the content of the current working directory. To view the content of other directories, simply type ls followed by the desired path, such as /home/username/Documents.

There are several options you can use with the ls command. For instance, ls -R lists all the files in the subdirectories, while ls -a displays hidden files and visible ones. The ls -lh option displays the file sizes in MB, GB, and TB units for ease of reading.

List of 40 Essential Linux Commands You Should Know

26. Cat Command

Another useful command in Linux is the cat command, which lists, combines, and writes file content to the standard output. To use the cat command, type cat followed by the file name and its extension, such as cat filename.txt. Other ways to use the cat command include creating a new file by typing cat > filename.txt, merging files by typing cat filename1.txt filename2.txt > filename3.txt, and displaying content in reverse order by typing tac filename.txt.

25. command: cp

The cp command is used to copy whole files or directories. To copy a single file from the current directory to another, type cp followed by the file name and the destination directory. Type the file names followed by the destination directory for copying multiple files. Type cp followed by the source file and the destination file to copy the content of one file to another in the same directory. Use the -R parameter before entering the source directory and the destination directory to copy a complete directory.

24. mv Command

Lastly, the mv command moves and renames files and directories. Type mv, the filename, and the destination directory to move a file to a new location. To rename a file, type mv followed by the old and new filename. The mv command does not produce any output upon execution.

Ram's blog - Essentials: Cheat sheets - Linux commands, Regex, VIM ...

23. mkdir Command

The mkdir command is a useful tool for creating directories in Linux. Users can define permissions for any directory they create, whether they create one or more at once. The user that executes this command must be able to create new folders in the parent directory, which is an important consideration. Otherwise, they may receive a permission denied error.

The basic syntax for the mkdir command is “mkdir [option] directory_name”. For example, you would enter “mkdir Music” to create a directory called Music. If you wanted to create a new directory called Songs inside Music, you would enter “mkdir Music/Songs”. Additionally, the mkdir command accepts many options, such as -p or –parents to create a directory between two existing folders, -m to set file permissions, and -v to print a message for each created directory.

22. rmdir Command

To permanently delete an empty directory, you can use the rmdir command. This command should be run by a user who has sudo access to the parent directory. For instance, you might type “rmdir -p mydir/personal1” to delete the empty subfolder personal1 and its parent folder mydir.


21. Command: rm

To remove files from a directory, use the rm command. It’s important to note that the user performing this command should have write permissions and remember the directory’s location, as this will permanently remove the file(s). The general syntax for the rm command is “rm filename”, and to remove multiple files, you would enter “rm filename1 filename2 filename3”. You can also add options such as -i to prompt system confirmation before deleting a file, -f to allow the system to remove without confirmation, and -r to delete files and directories recursively.

20. touch Command

With the Linux command line, the touch command enables you to create an empty file or to create and alter a timestamp. To create an HTML file named Web in the Documents directory, for instance, type “touch /home/username/Documents/Web.html”.

19. command: locate 

A file can be located in the database system using the locate command. By using the -i argument to disable case sensitivity, you can perform a search even if you don’t remember the precise name of the file. Use an asterisk to search for material with two or more words (). For instance, you would type “find -i schoolnote” to look for files that contain the words school and note.

18. Command: find

The find command is a strong tool for finding files in a certain directory and carrying out further tasks. The general syntax for using the find command is “find [option] [path] [expression]”. For instance, you can use the command “find /home -name notes.txt” to look for a file named notes.txt within the home directory and its subfolders. You may also use “find -name filename.txt” to search for files in the current directory and “find./ -type d -name directoryname” to search for directories when using the find command.

17. grep command

Another basic Linux command is the grep command, which stands for global regular expression print. You can find a term by searching through all the texts in a specific file. The grep command prints all lines that match the particular pattern as soon as it finds a match. Large log files can be filtered by using this command. You can use the command “grep blue notepad.txt” to look for the word blue in the file, for instance.

100 Essential Linux Commands for Every User - Linux Hint

16. df Command

The df command reports the system’s disk space usage, shown in percentage and kilobyte (KB). The general syntax for using the df command is “df [options] [file]”. For example, to see the current directory’s system disk space usage in a human-readable format, you can use the command “df -h”. You can find a term by searching through all the texts in a specific file. As soon as it detects a match, the grep command outputs all lines that match the specific pattern. This command can be used to sift through large log files. For example, to search for the word blue in the file, type “grep blue notepad.txt” into your computer’s command line.

15. Command: du

Use the du command to find out how much space a file or directory occupies. This command can be used to determine which system component consumes storage resources unnecessarily. While using the du command, keep in mind to specify the directory path. For instance, you can use the command “du /home/user/Documents” to-examine “/home/user/Documents”. The du command can be modified by adding a flag. For example, using “-s” will provide the overall size of a specified folder, while “-m” will provide folder and file information in MB.

14. Command: head

You can view the first ten lines of a text using the head command, and you can adjust how many lines are displayed by adding an option. Piped data can also be output to the CLI using the head command. The general syntax for using the head command is “head [option] [file]”. For instance, to view the first ten lines of note.txt in the current directory, you can use the command “head note.txt”. Other options you can add include “-n” or “–lines” to print the first customised number of lines, “-c” or “–bytes” to print the first customised number of bytes of each file, and “-q” or “–quiet” to not print headers specifying the file name.

13. tail Command

A helpful tool that shows the last ten lines of a file is the tail command. This command can be used to check for new data in a file or to read error messages. The general format of the command is “tail [option] [file]”. For example, to show the last ten lines of the colors.txt file, you would enter “tail -n colors.txt”.

7 Essential Linux Commands for Managing Users | by Mwiza Kumwenda ...

12. diff Command

The difference command, abbreviated as diff, is used to compare two files’ contents line by line. Instead of completely rewriting the source code, programmers frequently use this command to alter an existing application. The general format of the command is “diff [option] file1 file2”. For example, to compare two text files (note.txt and note_update.txt), you would enter “diff note.txt note_update.txt”. Options like -c, which shows the differences between two files in context, -u, which shows the output without extraneous information, and -i are suitable additions (makes the diff command case insensitive).

11. tar Command

The TAR file, a typical Linux format akin to ZIP with optional compression, is created by the tar command, a helpful utility that archives many files. The command’s fundamental syntax is “[Options] Tar [archive file] [the directory or file to be archived] “. For instance, you would type “tar -cvf newarchive.tar /home/user/Documents” to create a new TAR archive with the name newarchive.tar under the Documents directory. This program supports a wide range of parameters, including -x (extracts a file), -t (lists a file’s content), and -u (archives and adds to an existing archive file).

Basic Linux Commands | Linuxize

10. chmod Command

The read, write and execute permissions of a file or directory can be changed using the common command chmod. Each file in Linux has three different user classes associated with it: owner, group member, and others. The basic syntax of the command is “chmod [option] [permission] [file_name]”. For instance, you might type “chmod 777 note.txt” to change the permission type from -rwxrwxrwx to -rwxrwxrwx, which allows group members and others to read, write, and execute the file. Several arguments are available for this command, including -c or —changes (displays information when a change is made), -f or —silent (suppresses error messages), and -v or —verbose (displays information when a change is made) (displays a diagnostic for each processed file).

9. chown Command

A file, directory, or symbolic link’s ownership is changed using the chown command to the supplied username. The basic format of the command is “chown [option] owner[:group] file(s)”. For example, to make linuxuser2 the owner of filename.txt, you would enter “chown linuxuser2 filename.txt”.

8. jobs Command

The jobs command displays all the running processes along with their statuses. A procedure that the shell initiates is known as a job. Only the csh, bash, tcsh, and ksh shells support this command. The command’s fundamental syntax is “jobs [options] jobID”. Enter “jobs” in the CLI to see the status of the jobs running in the current shell. You can use the -l option, which lists process IDs and their details, the -n option, which lists jobs whose statuses have changed since the last notice, and the -p option (lists process IDs only).

7. kill command

The kill command is used to terminate an unresponsive program manually. It alerts applications that are doing inappropriately and tells them to end their processes. You need to know a program’s PID in order to terminate it (PID). You can run the command “ps ux” if you don’t know the PID. The syntax “kill [signal option]” can be entered once you are aware of the signal to use and the program’s PID.

6. Linux Command

The Linux command line offers various powerful tools that enable you to perform different tasks more efficiently. This text will explore some of these commands, their functionalities, and how to use them.

5. wget Command

The wget command is one of the most frequently used commands in Linux. This command is useful for downloading files from the internet without interfering with other processes. It supports HTTP, HTTPS, and FTP protocols and allows you to download entire websites recursively. To use it, you need to enter the wget command followed by the URL and any options you want to specify.

4. uname command

Another command that can provide valuable system information is the uname command. This command displays detailed information about your Linux system, such as the machine name, operating system, and kernel. You can use various options with this command to retrieve specific information you need.

3. top command

The top command is another useful tool that provides a real-time view of the current system and the running processes. It summarises the resource utilisation, including CPU and memory usage, and can assist you in locating and terminating a process that might be utilising excessive amounts of system resources.

2. history Command

The history command can help you reuse previously executed commands without the need to re-enter them. However, this command can only be executed by users with sudo privileges, and its functionality may vary depending on the Linux shell you use.

1. man Command

Lastly, the man command provides a comprehensive user manual for any commands or utilities you can run in terminal. It consists of nine sections, and you can specify the displayed section and command using various options.

In conclusion, mastering the Linux command line and its various tools can significantly increase your productivity and help you perform different tasks more efficiently.


Linux commands allow users to perform basic and administrative tasks efficiently and effectively from the terminal. Using the terminal gives users more flexibility over their system and access to features that are not always available through a graphical user interface.

Learning basic Linux commands is essential, especially for Virtual Private Server (VPS) users. Typically, each command consists of three parts – a command name, a flag or option, and a parameter or argument.

This article has discussed 30 common commands that are frequently used in Linux. These commands include apt-get for package installation, nano for file manipulation, htop for monitoring current processes, and ls for viewing directories.

We hope that this article has helped teach you the basic Linux commands. By learning and mastering these commands, you can effectively interact with your machine and efficiently perform various tasks.

Leave a Reply

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

Related Stories

Stay on op - Ge the daily news in your inbox