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
Syntax:
top [OPTIONS]
Key Info:
q
to quit.k
to kill a process (enter PID).M
to sort by memory, P
for CPU.Examples:
top
top -u username
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
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
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
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
, orpidof
to find PIDs.
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