Bash

⚙️ ps – Display Process Status

Syntax:

ps [OPTIONS]

Options:

Option Description
-e Show all processes
-f Full-format listing
-u User-oriented format
-aux Show all processes with user info (BSD style)

Examples:

ps
ps -e
ps -ef
ps aux
ps -u username

📊 top – Real-Time Process Monitoring

Syntax:

top [OPTIONS]

Key Info:

Examples:

top
top -u username

💽 df – Disk Space Usage

Syntax:

df [OPTIONS]

Options:

Option Description
-h Human-readable sizes (KB/MB/GB)
-T Show filesystem type
-a Include dummy filesystems

Examples:

df
df -h
df -Th

📦 du – Disk Usage of Files and Directories

Syntax:

du [OPTIONS] [DIRECTORY]

Options:

Option Description
-h Human-readable
-s Summary only
-a Show all files
-c Show total size

Examples:

du -h /home/user/
du -sh /var/log
du -ah . | sort -rh | head -10

🧠 free – Show Memory and Swap Usage

Syntax:

free [OPTIONS]

Options:

Option Description
-h Human-readable format
-m Show in MB
-g Show in GB
-t Display total summary

Examples:

free
free -h
free -m

☠️ kill – Terminate Processes by PID

Syntax:

kill [OPTIONS] PID

Options:

Option Description
-9 Force kill (SIGKILL)
-15 Graceful stop (SIGTERM - default)
-l List all signal names

Examples:

kill 1234
kill -9 4567
kill -15 8901

Use ps, top, or pidof to find PIDs.


⏱️ uptime – Show System Uptime

Syntax:

uptime

Description: Displays how long the system has been running, number of users, and load average.

Example:

uptime
# Output: 04:28:15 up 1 day,  3:12,  2 users,  load average: 0.45, 0.31, 0.28