Managing Processes - Paiet/Tech-Journal-for-Everything GitHub Wiki
- Monitoring Processes
-
ps (Process List)
- 3 options
- Unix options
- Single dash before options
- BSD options
- GNU Long options
- Two dashes before options
- Common usage
-
ps -aux
-
-a List all processes
-
-u Display user and performance data
-
-x Display processes not attached to a TTY
-
ps -u user List processes of specific user
- View process heirarchy
- Use
grep to find specific process
-
pgrep
- Same basic output as
ps | grep
pgrep cron
pgrep -u root cron
-
top
-
top -d 10 Display updates every 10 seconds
-
top -p 4244 Display stats on PID# 4244
- Single letter commands
-
k Kill a process
-
r Change a process' priority
-
P Sort by CPU usage
-
M Sort by MEM usage
-
free Displays basic MEM stats
- Killing Processes
-
kill command
- Kills process by PID
-
kill -l lists all the kill signals
- 1 SIGHUP
- 9 SIGKILL
- 15 SIGTERM
- Example
- Execute a command 2.
ps -u dpezet 3. kill -9 <PID>
-
killall command
- Kills process by name instead of PID
⚠️ **GitHub.com Fallback** ⚠️