The most important Linux commands are categorized by their function, ranging from basic navigation to advanced system management.
1. File and Directory Navigation ls: Lists all files and directories in the current location. cd: Changes your current directory (e.g., cd /home/user). pwd: Prints the absolute path of your current working directory. mkdir: Creates a new directory. rmdir: Removes an empty directory.
2. File Management touch: Creates a new empty file. cp: Copies files or directories. mv: Moves or renames files and directories. rm: Deletes files or directories (use rm -r for folders). cat: Displays the full contents of a file in the terminal. head / tail: Shows the first or last 10 lines of a file, respectively.
3. System and Process Monitoring sudo: Executes commands with administrative (root) privileges. top / htop: Provides a real-time, interactive view of running processes and resource usage. ps: Shows a snapshot of currently running processes. kill: Terminates a process using its Process ID (PID). df: Displays available disk space on all mounted file systems. free: Shows the amount of free and used memory (RAM).
4. Networking and Connectivity ping: Tests connectivity to a host or website. ip a: Displays network interface information and IP addresses. ssh: Securely connects to a remote server (e.g., ssh user@ip-address). curl / wget: Downloads files or interacts with URLs directly from the terminal.
5. Permissions and Ownership chmod: Changes the read, write, and execute permissions of a file or folder. chown: Changes the owner and group of a file or directory.
6. Search and Text Processing grep: Searches for a specific pattern or text inside files. find: Searches for files and directories based on names or attributes. man: Opens the official manual page for any command (e.g., man ls).