Skip to main content
Linux & CLI

Linux Shell & System Administration

Essential

Everyday Bash CLI commands, system diagnostics, permissions, networking sockets, processes, and disk management.

Instant Copy & SearchProduction Flagged SyntaxCurrent Flag Reference

Linux Shell & System Administration Interactive Command Directory

Browse, search, and copy battle-tested commands & syntax recipes (18 Total Commands).

18+ Verified Recipes
Search & Grep-rnI, --exclude-dir
grep -rnI "API_SECRET" /var/www/ --exclude-dir=node_modules

Recursively search directory for string, ignoring binary files, and displaying line numbers.

File Discovery-type f, -mtime, -exec
find /var/log -type f -name "*.log" -mtime +14 -exec gzip {} \;

Find all log files older than 14 days and compress them in-place with gzip.

Archiving & Compression-czvf
tar -czvf backup.tar.gz /etc/nginx /var/www

Create a gzip-compressed tarball archive of specified directories.

Remote Sync-avzP, --exclude
rsync -avzP --exclude='.git' ./build/ deploy@10.0.0.5:/var/www/app/

Fast incremental file transfer with archive permissions, compression, and progress bar.

Permissionschmod, chown -R
chmod 755 script.sh && chown -R www-data:www-data /var/www

Set executable read permissions and recursively change file ownership to www-data.

Port & Socket Inspection-tulpn
ss -tulpn | grep ":80\|"

Show all active listening TCP and UDP sockets with listening process PID and name.

Process Management-i, -t
lsof -i :3000 -t | xargs -r kill -9

Identify process ID occupying port 3000 and forcefully terminate it.

Process Monitoringaux --sort
ps aux --sort=-%mem | head -n 10

Display top 10 memory-consuming processes running on the operating system.

Disk & Storagedf -hT, du -sh
df -hT && du -sh /var/* | sort -hr | head -n 10

Inspect mounted filesystem capacities and identify largest directories on disk.

Systemd Servicesrestart, status
systemctl restart nginx && systemctl status nginx --no-pager

Restart systemd unit service and display real-time active status.

Journal Logs-u, -f, -n, --since
journalctl -u nginx.service -f -n 100 --since "1 hour ago"

Follow live service logs from systemd journal filtered by time duration.

Hardware Diagnosticsfree -h, lscpu
free -h && lscpu | grep -E "Model name|CPU\(s\):"

Print human-readable memory availability and CPU core architecture.

Network Inspection-nn, -i, -c, -w
tcpdump -nn -i eth0 port 80 or port 443 -c 100 -w capture.pcap

Capture 100 raw network packets on interface eth0 on ports 80/443 without DNS resolution and save to PCAP file.

Storage & I/O-xz
iostat -xz 1 5

Display extended disk I/O metrics every 1 second for 5 iterations, omitting inactive disks to diagnose storage bottlenecks.

Performance & Memoryinterval, count
vmstat 1 5

Monitor virtual memory paging, CPU run queues, system interrupts, and swap in/out rates in real time.

Process Diagnostics-p, -f, -e, -s
strace -p <PID> -f -e trace=network,file -s 256

Attach to running process ID with child fork tracing, filtering system calls to network and file operations with 256-byte string dumps.

Networking & Routingroute, addr
ip route show && ip addr show dev eth0

Display default kernel gateway routing tables and network interface IP/MAC configuration.

Text Processing-i
sed -i 's/OLD_STRING/NEW_STRING/g' /path/to/config.conf

Perform in-place atomic string substitution across configuration files using stream editor.

Zero Setup100% In-Browser Execution

Companion Developer Tools & Playgrounds

Accelerate command execution and syntax debugging with HelloAIHub suite of interactive tools.

Explore all developer tools

Linux Shell & System Administration: Command Groups & Quick Index

18 indexed entries across 18 sections
Search & Grep1 items
File Discovery1 items
Archiving & Compression1 items
Remote Sync1 items
Permissions1 items
Port & Socket Inspection1 items
Process Management1 items
Process Monitoring1 items
Disk & Storage1 items
Systemd Services1 items
Journal Logs1 items
Hardware Diagnostics1 items
Network Inspection1 items
Storage & I/O1 items
Performance & Memory1 items
Process Diagnostics1 items
Networking & Routing1 items
Text Processing1 items

Highlighted Flags & Syntax Examples in Linux Shell & System Administration

grep -rnI "API_SECRET" /var/www/ --exclude-dir=node_modules

Recursively search directory for string, ignoring binary files, and displaying line numbers.

Flags: -rnI, --exclude-dir
find /var/log -type f -name "*.log" -mtime +14 -exec gzip {} \;

Find all log files older than 14 days and compress them in-place with gzip.

Flags: -type f, -mtime, -exec
tar -czvf backup.tar.gz /etc/nginx /var/www

Create a gzip-compressed tarball archive of specified directories.

Flags: -czvf
rsync -avzP --exclude='.git' ./build/ deploy@10.0.0.5:/var/www/app/

Fast incremental file transfer with archive permissions, compression, and progress bar.

Flags: -avzP, --exclude

Frequently Asked Questions

Expert recommendations, common traps, and production best practices for Linux Shell & System Administration.

What is the difference between hard links and symbolic (soft) links in Linux?

A hard link points directly to the file's underlying inode on the filesystem; if the original file is deleted, the data remains accessible through the hard link. A symbolic link (symlink) is a special shortcut file containing a pathname reference; if the target file is deleted, the symlink breaks.

How does Linux file permission numbering (e.g., 755, 644) work?

Permissions consist of three octal digits for Owner, Group, and Others. Read=4, Write=2, Execute=1. 755 means Owner has 7 (4+2+1=rwx), Group has 5 (4+0+1=r-x), and Others have 5 (r-x). 644 means rw-r--r--.

What is the difference between SIGTERM (15) and SIGKILL (9)?

SIGTERM requests a process to terminate gracefully, allowing it to close open file handles, commit transactions, and remove temp files. SIGKILL immediately terminates the process at the OS kernel level and cannot be caught, blocked, or handled.

What is load average in Linux and how is it calculated?

Load average represents the average number of processes in a runnable state (CPU running or waiting in the run queue) plus those in an uninterruptible sleep state (waiting for disk or network I/O) over 1, 5, and 15 minute intervals. On a system with N CPU cores, a sustained load average exceeding N indicates CPU or disk I/O saturation.

How does the Linux Virtual File System (VFS) buffer cache and swap memory affect available RAM?

Linux opportunistically allocates unused memory to disk page cache and buffer cache to accelerate read operations. This memory is marked as available and reclaimed immediately when user applications request RAM. 'free -h' reports 'available' memory, which reflects truly unreserved RAM plus reclaimable page cache.

What is the difference between systemctl stop, restart, and reload?

'systemctl stop' sends SIGTERM and terminates the service process completely. 'systemctl restart' terminates the process and starts a fresh instance, causing brief request interruption. 'systemctl reload' instructs the running daemon (like Nginx) to reload its configuration files on the fly without dropping active TCP connections.

Cross-Hub Skill Acceleration

Combine command lookups with active coding interviews and complete career paths.

Need More Cheat Sheets?

Explore developer cheat sheets and syntax guides on HelloAIHub.

Browse All Cheat Sheets