📟 Linux Essentials¶
Practical linux commands used in day-to-day devops debugging sessions.
Linux & Networking Commands¶
File & Directory Management¶
- ls - Lists directory contents showing filenames, sizes, and permissions.
- cd - Changes your current working directory location.
- pwd - Prints the absolute path of your current directory.
- mkdir - Creates new directories, including nested paths if specified.
- rm - Deletes files or entire directories permanently from storage.
- cp - Copies files or complete directory structures to a new destination.
- mv - Moves or renames files and directories.
- find - Searches the filesystem for files matching specific criteria.
- touch - Creates empty files or updates existing file timestamps.
- ln - Creates shortcut links pointing to files or directories.
File Viewing & Editing¶
- cat - Displays the entire content of a file on screen.
- tail - Shows the end of a file and monitors live updates.
- head - Displays the first few lines of a file.
- less - Opens files for interactive, screen-by-screen scrolling and reading.
- grep - Searches text files for lines matching specific patterns.
- awk - Extracts and processes data fields arranged in columns.
- sed - Edits text streams to find and replace content automatically.
- wc - Counts the lines, words, and characters inside files.
- diff - Compares two files side-by-side to highlight differences.
- vim - Opens a powerful text editor directly inside the terminal.
Process Management¶
- ps - Snapshots and lists currently active system processes.
- top - Displays real-time CPU, memory, and process statistics continuously.
- htop - Provides an interactive, color-coded process viewer and manager.
- kill - Stops a running process using its unique ID number.
- pkill - Stops running processes based on their matching names.
- nohup - Keeps commands running even after you log out.
- bg / fg - Switches background tasks to the foreground or vice versa.
- jobs - Lists active tasks running in your current background session.
- systemctl - Controls system background services and system startup states.
- crontab - Schedules automation scripts to run at specific times.
Networking¶
- curl - Sends data requests to servers using internet protocols.
- wget - Downloads files directly from internet web links.
- ping - Checks if a remote computer is reachable and active.
- netstat - Lists network connections, routing tables, and open interface ports.
- ss - Offers a faster, modern utility to inspect network sockets.
- ssh - Establishes encrypted terminal connections to secure remote servers.
- scp - Copies files securely between different computers over network links.
- rsync - Synchronizes files efficiently between directories or network machines.
- traceroute - Maps the path data takes across internet routers to a host.
- nslookup - Queries internet domain name servers to find IP addresses.
Disk & System Monitoring¶
- df - Reports available and used storage space on filesystems.
- du - Calculates the storage space used by specific files or folders.
- free - Shows used and available physical RAM and virtual swap memory.
- uptime - Displays how long the system has been running continuously.
- uname - Prints the operating system name and kernel version details.
- lsof - Lists all files and network ports opened by running processes.
- iostat - Monitors input and output storage performance data.
- vmstat - Displays virtual memory, process, and system activity summaries.
Permissions & User Management¶
- chmod - Modifies access read, write, and execute permissions of files.
- chown - Changes the owner and group identity of files or folders.