I present to you a compilation of the most useful Linux commands about Process and Job Control
Run commands and applications
Run application in current folder
Runs a program located in the current directory.
./application
Run command
Executes a command in the terminal.
command
Start process in background
Runs a command in the background, allowing you to continue using the terminal.
command &
Cancel command
Stops the execution of a running command.
Ctrl + C
Send command to background
Suspends a foreground command and sends it to the background.
Ctrl + Z
Retrieve process sent to background
Resumes a background process in the terminal.
bg
Bring job to foreground
Moves a specific job from the background to the foreground.
fg jobID
Start command as root
Executes a command with superuser privileges.
sudo command
Start executable with graphical interface as root
Runs a graphical application with superuser privileges.
sudo executable
Multiple session manager in terminal
Allows managing multiple sessions in the terminal.
screen -S session_name
Stop a screen session
Allows you to disconnect a screen
session without ending it.
Ctrl + A, D
List processes and tasks
Show background processes with jobID and PID
Displays background processes and their identifiers.
jobs -l
Show processes
Lists all running processes on the system.
ps
Show active processes
Displays all active processes with detailed information.
ps -eafw
Show system process tree
Visually represents the process hierarchy.
pstree
Show processes ordered by memory usage
Lists processes sorted by memory usage.
ps aux | sort -k 5
Show detailed information of a specific process
Displays details about a particular process using its PID.
ps -p PID -o pid,comm,%cpu,%mem,etime
Monitor processes in real time
Displays active processes in real time.
top
Check the status of a process
Checks the status of a specific process (Running, Stopped, etc.).
ps -o stat= -p PID
Change the priority of a process
Modifies the priority of a running process.
renice -n new_priority -p PID
Send signal to a process
Sends a specific signal to a process to control it.
kill -s SIGNAL PID
Terminate processes
Terminate process to reload configuration
Sends a signal for a process to reload its configuration.
kill -1 Process_ID
Forcefully terminate process by PID
Ends a process forcefully using its ID.
kill -9 PID
Terminate process by name
Closes all processes that match a specific name.
killall -9 name
Remove all processes of a specific user
Closes all processes of a given user.
kill -u username
Command aliases
Set a temporary alias for command
Creates an alias that lasts only for the current session.
alias cmd='command'
Remove alias
Deletes a previously defined alias.
unalias cmd
Set a permanent alias
Adds an alias to your .bashrc
or .bash_profile
file to make it available in every session.
echo "alias cmd='command'" >> ~/.bashrc
source ~/.bashrc
Search for a process by name
Locates a specific process by its name.
pgrep process_name
Show resource usage of a specific process
Displays the resource usage (CPU, memory) of a particular process.
pmap PID