Process Control Commands in Unix/Linux Last Updated : 18 Mar, 2021 Comments Improve Suggest changes 4 Likes Like Report Process control commands in Unix are: bg - put suspended process into background fg - bring process into foreground jobs - list processes bg Command : bg is a process control command that resumes suspended process while keeping them running in the background. User can run a job in the background by adding a "&" symbol at the end of the command. Syntax : bg [job] Options The character % introduces a job specification. The Job can be a process ID (PID) number, or we can use one of the following symbol combinations: %Number : Use the job number such as %1 or %2. %String : Use the string whose name begins with suspended command such as %commandNameHere or %ping. %+ OR %% : Refers to the current job. %- : Refers to the previous job. bg examples Command bg %1 Output: The stopped job will resume operation, but remain in the background. It will not receive any input from the terminal while it's in the background, but it will keep running. fg Command : fg command moves a background job in the current shell environment into the foreground. Use the job ID parameter to indicate a specific job to be run in the foreground. If this parameter is not supplied, the fg command uses the job most recently suspended, placed in the background, or run as a background job . Syntax : fg [ %job] Options %job: Specifies the job that you want to run in the foreground. fg examples Command $ fg Output: It will resume the most recently suspended or background job. Command $ fg 1 Output: It brings the job with the id 1 into the foreground, resuming it if it was suspended. Jobs Command : Jobs command is used to list the jobs that you are running in the background and in the foreground. If the prompt is returned with no information no jobs are present. All shells are not capable of running this command. This command is only available in the csh, bash, tcsh, and ksh shells. Syntax : jobs [JOB] Options JOB Job name or number. -l Lists process IDs in addition to the normal information. -n List only processes that have changed status since the last notification. -p Lists process IDs only. -r Restrict output to running jobs. -s Restrict output to stopped jobs. jobs command examples To display the status of jobs in the current shell: Command $ jobs Output: [1] 7893 Running gpass & [2] 7904 Running gnome-calculator & [3]- 7955 Running gedit fetch-stock-prices.py & [4]+ 7958 Stopped ping cyberciti.biz To display the process ID or jobs for the job whose name begins with “p,”: Command $ jobs -p %p OR $ jobs %p Output: [4]- Stopped ping cyberciti.biz The character % introduces a job specification. In this example, you are using the string whose name begins with suspended command such as %ping. Pass the -p option to jobs command to display PIDs only: Command $ jobs -p Output: 7895 7906 7910 7946 Pass the -r option to jobs command to display only running jobs only: Command $ jobs -r Output: [1] Running gpass & [2] Running gnome-calculator & [3]- Running gedit fetch-stock-prices.py & Create Quiz Comment S Shivani Ghughtyal Follow 4 Improve S Shivani Ghughtyal Follow 4 Improve Article Tags : Misc Linux-Unix Explore Getting Started with LinuxIntroduction to Linux Operating System7 min readLINUX Full Form - Lovable Intellect Not Using XP2 min readDifference between Linux and Windows7 min readLinux Distributions6 min readDifference between Unix and Linux6 min readInstallation with LinuxInstallation of Arch Linux in VirtualBox4 min readFedora Linux Operating System5 min readHow to install Ubuntu on VirtualBox?6 min readHow to Install Linux Mint?3 min readInstallation of Kali Linux in Virtual Machine2 min readHow to Install Linux on Windows PowerShell Subsystem?2 min readHow to Find openSUSE Linux Version?2 min readInstallation of CentOS2 min readLinux CommandsLinux Commands15+ min readEssential Unix Commands7 min readFind Command in Linux with Examples7 min readLinux File SystemLinux File System12 min readLinux File Hierarchy Structure5 min readLinux Directory Structure6 min readLinux KernelLinux Kernel4 min readKernel in Operating System3 min readHow Linux Kernel Boots?11 min readDifference between Operating System and Kernel3 min readLinux Kernel Module Programming: Hello World Program7 min readLinux Loadable Kernel Module7 min readLoadable Kernel Module - Linux Device Driver Development4 min readLinux Networking ToolsNetwork configuration and troubleshooting commands in Linux5 min readHow to configure network interfaces in CentOS?5 min readCommand-Line Tools and Utilities For Network Management in Linux8 min readLinux - Network Monitoring Tools4 min readLinux ProcessProcesses in Linux/Unix5 min readHow to Manage Process in Linux4 min readGetting System and Process Information Using C Programming and Shell in Linux2 min readProcess states and Transitions in a UNIX Process4 min readLinux FirewallLINUX Firewall7 min readiptables command in Linux with Examples7 min readHow to Configure your Linux Firewall - 3 Methods12 min readShell Scripting & Bash ScriptingIntroduction to Linux Shell and Shell Scripting7 min readUnderstanding Terminal, Console, Shell and Kernel3 min readHow to Create a Shell Script in linux7 min readShell Scripting - Different types of Variables4 min readBash Scripting - Introduction to Bash and Bash Scripting12 min readBash Script - Define Bash Variables and its types12 min readShell Scripting - Shell Variables6 min readBash Script - Difference between Bash Script and Shell Script4 min readShell Scripting - Difference between Korn Shell and Bash shell3 min readShell Scripting - Interactive and Non-Interactive Shell3 min readShell Script to Show the Difference Between echo â$SHELLâ and echo â$SHELLâ4 min readLinux Administrator SystemWhat is Linux System Administration?6 min readBeginner's Guide to Linux System Administration5 min readHow to Monitor System Usage, Outages and Troubleshoot Linux Servers6 min readLinux - Systemd and its Components3 min readBoot Process with Systemd in Linux3 min readHow to Control Systemd Services on Remote Linux Server2 min readHow to Start, Stop and Restart Services in Linux Using systemctl Command9 min read Like