Top 10 Most Common Linux Commands

Below are the top 10 most commonly used linux commands that everyone should know


1 - sudo command :

The sudo command stands for "superuser do" and is used in Unix-based operating systems like Linux and macOS to execute commands with elevated privileges. In other words, it allows users to perform administrative tasks that require root or superuser permissions, without having to log in as the root user.

When a user types a command with sudo in front of it, the command is executed with the permissions of the root user. This means that the user can perform actions that are normally restricted to the root user, such as installing or updating software, modifying system files, and changing system settings.

For example, if a user wants to install a software package on their Linux system, they can use the sudo command to run the installation command with root privileges. The command might look something like this:


In this case, the sudo command allows the user to install the package as the root user, even though they are logged in as a regular user.

It is important to use the sudo command with caution, as it gives users the ability to make changes to the system that can have unintended consequences. It is recommended to only use sudo when necessary and to always double-check the command before executing it with root privileges.

Note : If any of the below command doesn't work for you simply write sudo before it.

2 - ls command

The ls command is a command-line utility in Unix-based operating systems like Linux and macOS, used to list the contents of a directory. When executed, ls displays a list of the files and directories in the current working directory, or in the specified directory if provided as an argument.


3 - cd command

The cd command is a command-line utility in Unix-based operating systems like Linux and macOS, used to change the current working directory. When executed, cd changes the current directory to the specified directory.

Here are some common uses of the cd command:

1 - Change the current directory to the home directory:


2 - Change the current directory to a specific directory:


3 - Change the current directory to the parent directory:


4 - Change the current directory to the previous directory (the directory you were in before the current directory):


5 - Change the current directory to a directory specified by a relative path:


4 - chmod command

The chmod command is a command-line utility in Unix-based operating systems like Linux and macOS, used to change the permissions of files and directories. When executed, chmod changes the access permissions of one or more specified files or directories.

In Unix-based systems, file permissions are represented by a set of three numbers, each of which represents the permission settings for the file owner, the group owner, and other users. The numbers are based on a binary system, with each digit representing the permissions of the corresponding user group.

0: No permissions
1: Execute only
2: Write only
3: Write and execute
4: Read only
5: Read and execute
6: Read and write
7: Read, write, and execute

For example, the number 755 would represent the following permissions:

7: Read, write, and execute permissions for the file owner
5: Read and execute permissions for the group owner
5: Read and execute permissions for other users

This would allow the file owner to read, write, and execute the file, while the group owner and other users would only be able to read and execute the file.


5 - mkdir command

The mkdir command is a command-line utility in Unix-based operating systems like Linux and macOS, used to create a new directory (also known as a folder) in the file system. When executed, mkdir creates a new directory with the specified name in the current working directory, or in the specified directory if provided as an argument.

1 - Create a new directory in the current working directory:


2 - Create a new directory with a specific path:


3 - Create multiple directories at once, using the -p option to create parent directories if they don't exist:


4 - Create a new directory with specific permissions, using the -m option to set the permissions in octal format:


6 - rmdir command

The rmdir command is a command-line utility in Unix-based operating systems like Linux and macOS, used to remove empty directories. When executed, rmdir removes the specified empty directory.

Here are some common uses of the rmdir command:

1 - Remove a directory:


2 - Remove multiple directories at once:


7 - rm command :

The rm command is a command-line utility in Unix-based operating systems like Linux and macOS, used to remove files or directories. When executed, rm permanently deletes the specified files or directories.

Here are some common uses of the rm command:

1 - Remove a single file:


2 - Remove multiple files at once:


8 - ping command :

The ping command is a command-line utility in Unix-based operating systems like Linux and macOS, used to test the connectivity between two network devices. When executed, ping sends a series of packets to a specified IP address or domain name and waits for a response.

Here are some common uses of the ping command:

1 - Test connectivity to a specific IP address:


2 - Test connectivity to a specific domain name:


9 - echo command :

The echo command is a command-line utility in Unix-based operating systems like Linux and macOS, used to display a message on the terminal. When executed, echo prints the specified message to the standard output.

Here are some common uses of the echo command:

1 - Display a message on the terminal:


10 - clear command :

The clear command is a command-line utility in Unix-based operating systems like Linux and macOS, used to clear the terminal screen. When executed, clear erases the contents of the terminal and moves the cursor to the top left corner of the screen.

Here are some common uses of the clear command:

1 - Clear the terminal screen:

Comments

Popular posts from this blog

Top 10 best pc games to try in 2023

How to enable developer option in xiaomi/poco/redmi phones

Remotely connect to your pc over internet