DEV Community

Elayaraj C
Elayaraj C

Posted on

LINUX COMMANDS DAY 2

Image description

LINUX COMMANDS
Here are the 50 essential Linux commands with explanations:

Basic File and Directory Commands

  1. ls – Lists files and directories.
  2. pwd – Prints the current working directory.
  3. cd – Changes directories.
  4. mkdir – Creates a new directory.
  5. mv – Moves or renames files and directories.
  6. cp – Copies files and directories.
  7. rm – Removes (deletes) files or directories.
  8. touch – Creates a new empty file.
  9. ln – Creates symbolic (soft) or hard links.
  10. clear – Clears the terminal screen.

File Viewing and Editing

  1. cat – Displays the contents of a file.
  2. echo – Prints text or variables to the terminal.
  3. less – Views a file page-by-page.
  4. man – Shows the manual for a command.
  5. uname – Displays system information.
  6. whoami – Shows the current logged-in user.
  7. tar – Archives files (tarballs).
  8. grep – Searches for patterns in files.
  9. head – Displays the first few lines of a file.
  10. tail – Displays the last few lines of a file.

File Comparison and Sorting

  1. diff – Compares two files line by line.
  2. cmp – Compares two files byte by byte.
  3. comm – Finds common and unique lines in two files.
  4. sort – Sorts the lines of a text file.
  5. export – Sets environment variables.

File Compression and Networking

  1. zip – Compresses files into a .zip archive.
  2. unzip – Extracts files from a .zip archive.
  3. ssh – Securely connects to a remote server.
  4. service – Manages system services.
  5. ps – Lists running processes.

Process and Disk Management

  1. kill / killall – Terminates processes.
  2. df – Displays disk space usage.
  3. mount – Mounts a filesystem.
  4. chmod – Changes file permissions.
  5. chown – Changes file ownership.

Networking and Security

  1. ifconfig – Displays or configures network interfaces.
  2. traceroute – Shows the path packets take to a destination.
  3. wget – Downloads files from the web.
  4. ufw – Manages the firewall (Ubuntu).
  5. iptables – Configures packet filtering rules.

Package Management and System Administration

  1. apt, pacman, yum, rpm – Package managers for different Linux distros.
  2. sudo – Runs a command as the superuser (root).
  3. cal – Displays a calendar.
  4. alias – Creates shortcuts for commands.
  5. dd – Copies and converts files (often used for disk cloning).
  6. wheris – Shows the location of a command.
  7. whatis – Provides a brief description of a command.
  8. top – Displays real-time system resource usage.
  9. useradd – Creates a new user.
  10. passwd – Changes a user’s password.

Top comments (0)

👋 Kindness is contagious

If this article connected with you, consider tapping ❤️ or leaving a brief comment to share your thoughts!

Okay