Most used Linux commands
158 views
ls - List Files:
    Purpose: Lists files and directories in the current directory.
    Example: ls -l provides detailed information like permissions, owners, and sizes.

cd - Change Directory:
    Purpose: Navigates to a different directory in the file system.
    Example: cd /var/www moves to the "/var/www" directory.

pwd - Print Working Directory:
    Purpose: Shows the full path of the current working directory.
    Example: pwd displays something like "/home/user/documents."

cp - Copy:
    Purpose: Copies files or directories.
    Example: cp file.txt /backup copies "file.txt" to the "/backup" directory.

mv - Move:
    Purpose: Moves files or directories.
    Example: mv file.txt /newlocation relocates "file.txt" to "/newlocation."

rm - Remove:
    Purpose: Deletes files or directories.
    Example: rm unwanted.txt removes the "unwanted.txt" file.

chmod - Change Mode:
    Purpose: Modifies file or directory permissions.
    Example: chmod 755 script.sh grants read, write, and execute permissions to the owner, and read and execute permissions to others.

ps - Process Status:
    Purpose: Lists currently running processes.
    Example: ps aux shows detailed information about all processes.

top - System Monitoring:
    Purpose: Displays real-time information about system resources and processes.
    Example: Simply type top in the terminal.

grep - Global Regular Expression Print:
    Purpose: Searches for a specific pattern in files.
    Example: grep "error" log.txt finds lines containing the word "error" in the "log.txt" file.

tar - Tape Archive:
    Purpose: Creates or extracts compressed archive files.
    Example: tar -cvf archive.tar.gz folder/ creates a compressed archive of the "folder."

find - Search for Files:
    Purpose: Searches for files and directories based on specified criteria.
    Example: find /home/user -name "*.txt" searches for all text files in the "/home/user" directory.
Top