1. pwd (Print Working Directory):
    The pwd command is used to display the current working directory in the Linux terminal. When you run this command, it will print the absolute path of the directory you are currently in.

Example:

$ pwd
/home/user/documents
  1. ls (List):
    The ls command is used to list the files and directories in the current working directory. By default, it displays the names of the files and directories in a simple list format.

Example:

$ ls
file1.txt file2.txt folder1 folder2
  1. cd (Change Directory):
    The cd command is used to change the current working directory. You can navigate to a different directory by specifying its path.

Example:

$ cd /home/user/documents/folder1
  1. mkdir (Make Directory):
    The mkdir command allows you to create new directories (folders) in the file system.

Example:

$ mkdir new_folder
  1. df (Disk Free):
    The df command is used to display information about the disk space usage of the file system.

Example:

$ df -h
Filesystem      Size  Used  Avail  Use%  Mounted on
/dev/sda1       100G  50G   50G    50%   /
  1. rm (Remove):
    The rm command is used to delete files or directories. Be cautious when using this command as deleted files cannot be easily recovered.

Example:

$ rm file1.txt
  1. cp (Copy):
    The cp command is used to copy files or directories from one location to another.

Example:

$ cp file1.txt /backup
  1. mv (Move):
    The mv command is used to move files or directories from one location to another. It can also be used to rename files or directories.

Example:

$ mv file1.txt /home/user/documents/folder1
  1. du (Disk Usage):
    The du command is used to display disk usage information for files and directories.

Example:

$ du -h file1.txt
10K     file1.txt
  1. ssh (Secure Shell):
    The ssh command is used to remotely access and manage a computer over a network. It provides a secure encrypted connection.

Example:

$ ssh [email protected]
  1. ifconfig (Interface Configuration):
    The ifconfig command is used to display network interface configuration information, such as IP addresses, netmask, and network-related statistics.

Example:

$ ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0A:CD:22:F3:11  
          inet addr:192.168.1.10  Bcast:192.168.1.255  Mask:255.255.255.0
  1. cat (Concatenate):
    The cat command is used to display the content of a file in the terminal. It can also be used to concatenate and display multiple files’ contents.

Example:

$ cat file1.txt
This is the content of file1.txt
  1. grep (Global Regular Expression Print):
    The grep command is used to search for a specific pattern or text in files. It can be used with regular expressions for powerful searches.

Example:

$ grep "error" log.txt
  1. nano/vi (Text Editors):
    The nano and vi commands are text editors that allow you to create and modify text files directly from the terminal.

Example (using nano):

$ nano newfile.txt
  1. man (Manual Pages):
    The man command is used to display the manual pages for various commands. It provides detailed information about how to use the specified command.

Example:

$ man ls
  1. ping:
    The ping command is used to test the reachability of a host (usually through its IP address) on a network and measure the round-trip time for packets.

Example:

$ ping google.com
  1. wget:
    The wget command is used to download files from the internet via HTTP, HTTPS, or FTP protocols.

Example:

$ wget https://example.com/file.zip
  1. chmod (Change Mode):
    The chmod command is used to change the permissions of files and directories in Linux.

Example:

$ chmod 755 script.sh
  1. chown (Change Owner):
    The chown command is used to change the ownership of files and directories to a specific user or group.

Example:

$ chown user:group file.txt
  1. ps (Process Status):
    The ps command is used to display information about running processes on the system.

Example:

$ ps -ef
  1. kill:
    The kill command is used to terminate processes by sending them signals. The most common signal is SIGKILL (signal 9) to forcefully terminate a process.

Example:

$ kill PID
  1. tar (Tape Archive):
    The tar command is used to create, view, or extract tar archives, which can contain multiple files and directories.

Example (creating a tar archive):

$ tar -cvf archive.tar file1.txt file2.txt

These are some of the most common Linux commands along with their brief descriptions and examples. Linux offers a wide range of commands and options to accomplish various tasks efficiently from the command line.

Tags: