LINUX COMMANDS
Here are the 50 essential Linux commands with explanations:
Basic File and Directory Commands
- ls – Lists files and directories.
- pwd – Prints the current working directory.
- cd – Changes directories.
- mkdir – Creates a new directory.
- mv – Moves or renames files and directories.
- cp – Copies files and directories.
- rm – Removes (deletes) files or directories.
- touch – Creates a new empty file.
- ln – Creates symbolic (soft) or hard links.
- clear – Clears the terminal screen.
File Viewing and Editing
- cat – Displays the contents of a file.
- echo – Prints text or variables to the terminal.
- less – Views a file page-by-page.
- man – Shows the manual for a command.
- uname – Displays system information.
- whoami – Shows the current logged-in user.
- tar – Archives files (tarballs).
- grep – Searches for patterns in files.
- head – Displays the first few lines of a file.
- tail – Displays the last few lines of a file.
File Comparison and Sorting
- diff – Compares two files line by line.
- cmp – Compares two files byte by byte.
- comm – Finds common and unique lines in two files.
- sort – Sorts the lines of a text file.
- export – Sets environment variables.
File Compression and Networking
- zip – Compresses files into a .zip archive.
- unzip – Extracts files from a .zip archive.
- ssh – Securely connects to a remote server.
- service – Manages system services.
- ps – Lists running processes.
Process and Disk Management
- kill / killall – Terminates processes.
- df – Displays disk space usage.
- mount – Mounts a filesystem.
- chmod – Changes file permissions.
- chown – Changes file ownership.
Networking and Security
- ifconfig – Displays or configures network interfaces.
- traceroute – Shows the path packets take to a destination.
- wget – Downloads files from the web.
- ufw – Manages the firewall (Ubuntu).
- iptables – Configures packet filtering rules.
Package Management and System Administration
- apt, pacman, yum, rpm – Package managers for different Linux distros.
- sudo – Runs a command as the superuser (root).
- cal – Displays a calendar.
- alias – Creates shortcuts for commands.
- dd – Copies and converts files (often used for disk cloning).
- wheris – Shows the location of a command.
- whatis – Provides a brief description of a command.
- top – Displays real-time system resource usage.
- useradd – Creates a new user.
- passwd – Changes a user’s password.
Top comments (0)