🐧 Linux / Shell Scripting
Beginner
How do ps and kill work for process management?
Answer
ps lists running processes. ps aux shows all processes for all users with CPU/memory usage, PID, and command. ps -ef shows a full-format listing. Filter with ps aux | grep nginx. kill PID sends SIGTERM (15) to gracefully stop a process, giving it time to clean up. kill -9 PID sends SIGKILL — an immediate, forceful termination the process cannot catch or ignore. kill -l lists all available signals. Use pkill processname to kill by name and killall processname to kill all instances. Always prefer SIGTERM first and resort to SIGKILL only if the process does not respond.
Previous
How do chmod and chown control file permissions?
Next
How do df and du help with disk usage?