[email protected]Support 24/7 · Billing 09:00 – 00:00LinkedInXFacebook
NexonHost
Netherlands Dedicated ServersAmsterdam · Equinix AM6Germany Dedicated ServersFrankfurt · Equinix FR4Romania Dedicated ServersBucharest · VoxilityAustria Dedicated ServersVienna · Interxion VIEBulgaria Dedicated ServersSofia · TelepointFrance Dedicated ServersParis · Interxion PAR — Marseille · Digital Realty MRS3Ireland Dedicated ServersDublin · Equinix DB2Italy Dedicated ServersMilan · Irideos AvalonPoland Dedicated ServersWarsawSpain Dedicated ServersMadrid · Equinix MD2United States Dedicated ServersAshburn · Equinix DC
All articles
Getting startedOctober 11, 2023

How to use fg command in Linux.

How To Use Fg Command In Linux.

$ fg  job_spec

Additionally, you can invoke one of the symbols shown below to reference a job on the current shell.

%- – This represents a previous job

%% or %+ – This shows the current job.

%number – This represents the job number, for instance, %3 or %4.

%String – A job started by a command that comprises a string, e.g., %ping

We will simulate sending a job to the background and then bringing it to the foreground using the fg command.

So, launch your terminal and execute the ping command as shown such that it continuously sends ICMP echo requests without stopping.

$ ping nexonhost.com

Then interrupt it by pressing CTRL + Z. This causes it to stop running in the foreground of the current shell and run to the background. Use the jobs command to displays all jobs that are currently suspended or running in the background.

$ jobs -l

Take note of the output. Here, the 1 is job_spec

[1]+ 2547 Stopped                 ping google.com

Now, to bring the ping command to the foreground, use the fg command as follows:

$ fg %1

From the output, you can see that we have brought the ping command back to the foreground. You can also run the command below, which brings to the foreground the previously suspended command.

$ fg %-

For additional information about the fg command run:

$ fg --help
Keep reading
How to Change Root Password in Ubuntu Linux
March 13, 2023

How to Change Root Password in Ubuntu Linux

How To Change Root Password In Ubuntu Linux This tutorial explains how to temporally change to the root user account and how to set the root password on Ubuntu systems. The root user (or superuser) is a special user account that is present on all Linux and Unix-like systems. It has full access to…

Read article
How to use History Command in Linux.
March 13, 2023

How to use History Command in Linux.

How To Use History Command In Linux. In this article, we will talk about the history command, which allows you to view a list of previously executed commands, search through the list, and manipulate the history file. Using the history Command and History Expansions history is a shell builtin, and…

Read article
How to Run Linux Commands in Background
March 13, 2023

How to Run Linux Commands in Background

How To Run Linux Commands In Background. In this article, we will talk about the background processes is Linux. We will show you how to start a command in the background and how to keep the process running after the shell session is closed. In this article, we will talk about the background…

Read article
Get in Touch

Together, Let’s Build a Faster, Safer Internet.

Build scalable infrastructure with NexonHost — high-performance dedicated servers, VPS hosting, cloud hosting, and DDoS protection across Europe.

Get Started →Contact Us
[email protected]Support 24/7 · Billing 09:00 – 00:00