Commands Mostly Used For Navigation And File Management
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.
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.
The cd command helps you to move around from one directory to another and browse the entire file-system without hitting a snag.
To create a new folder through the terminal, you will be required to employ the mkdir command.
The lsblk command displays the list of all the information related to all the block devices.
This command is used to mount the file-system 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.
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.
The rm command is used to delete objects like file/ folders, directories, symbolic links, etc. from the file-system.
The cp command is used to copy files, groups of files or directory from one folder to another right from the terminal.
The mv command is used to move single or multiple files or directories from one location to another in the file system.
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.
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.
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.
The less command can be used for reading or viewing the contents of a text file without having to interrupt the ongoing terminal session.
The ln command is used for creating symbolic links between any specific file.
The dd 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.
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.
The ps command is one of the handiest commands to display the list of currently running processes and PIDs by your machine.
service is 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 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.
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.
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.
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.
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.
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 grate 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.
The 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.
The echo command is 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.
The chmod command comes into play 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 personalised 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 character wise.
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.
The tar command is used for creating an archive and extracting the archive files.
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.