Do you know how many commands does Linux have altogether? Infinitely many. And to be precise, it has as many commands as you want to dig out, and as few, as you really need. So what’s the secret way to memorize all of them?
Well, I’d say you can’t do that, and perhaps nobody ever does. Moreover, there is no point in mastering all terminal tools and commands – you could save your time for other important things.
But if your ultimate goal is to understand Linux well, this is your place. Here in this article, we have potentially narrowed down some of the mostly used linux commands by categories to make your goal easy-peasy of understanding Linux better.
Whether you are just starting out or have made some progress into the field; below is the small subset of basic linux commands for beginners.
50 Most Common Linux Commands for Beginners
We’ve also provided the description for each command that basically includes the use of it and other important stuff associated.
Learning Linux navigation commands and getting aware of what’s around is the most fundamental core skill you should master before jumping-off to further exploration. Practicing File management commands in linux is the bare minimum to get started with this fantastic Unix-like operating system.
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 filesystem.
By using Is command, you can display the contents (files and folders) of the current or any particular directory. Not to mention, it’s also one of the frequently used commands in the Unix world.
This command helps you to move around from one directory to another and browse the entire filesystem without hitting a snag.
To create a new folder through the terminal, you will be required to employ the mkdir command.
This command displays the list of all the information related to all the block devices.
It’s used to mount the filesystem found on a device to the big tree structure rooted at ‘/‘
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.
Used for displaying the essential information about the total space and available space on the filesystem. For system administrators, it’s an important command on their arsenal to monitor and analyze real-time server as well.
Used to delete objects like file/ folders, directories, symbolic links, etc. from the filesystem.
It is used to copy files, groups of files or directory from one folder to another right from the terminal.
Used to move single or multiple files or directories from one location to another in the file system.
This 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.
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.
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.
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.
It can be used for reading or viewing the contents of a text file without having to interrupt the ongoing terminal session.
The In command is used for creating symbolic links between any specific file.
This command-line utility is used for copying and converting files from one type to another.
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.
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 familiarize.
It’s one of the handiest commands to display the list of the currently running processes and PIDs by your machine.
It’s a de-facto command that can be leveraged for running a System V init script.
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.
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.
batch command is used for running system services in a pre-defined 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.
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.
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.
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.
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.
This 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.
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.
This 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.
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.
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 command, it will display all lines that contain the searched pattern.
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.
clear command is used for wiping out your existing terminal screen.
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.
It’s used for displaying or outputting a specific text/string that is passed as an argument to the terminal console.
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.
This command comes into rescue when a user wants to change or modify the access mode/permission of system or objects files.
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.
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.
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.
The history command is used for viewing the executed command of your previous terminal sessions.
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.
Using the banner command, you can actually create your own personalized banners by printing the ASCII character string in a large letter.
rev command takes the input from the user and writes them to the standard output by reversing the lines characterwise.
You can make use of this command to view the user manual or documentation page of any command we can run on the terminal.
The tar command is used for creating an archive and extracting the archive files.
It offers the users to get a one-line manual page description and prints out system commands that match them.
It was arguably difficult for us to handpicked the most useful linux commands among the never-ending list, but we tried to lay down the basic commands that you’ll certainly require to understand how Linux works. We hope it will help you in your future explorations and to strengthen your hold on the working of the operating system.