Birmingham mumbai



Download 15,21 Mb.
Pdf ko'rish
bet217/482
Sana13.01.2022
Hajmi15,21 Mb.
#355107
1   ...   213   214   215   216   217   218   219   220   ...   482
Bog'liq
Mastering Ubuntu Server Gain expertise in the art of deploying, configuring, managing, and troubleshooting Ubuntu Server by Jay LaCroix (z-lib.org)

[
 164 
]
I gave you an example of the 
ps
 command to show that the process was still running 
in the background, but there's actually a dedicated command for that purpose, and 
that is the 
jobs
 command. If you execute the 
jobs
 command, you'll see in the output 
a list of all the processes running in the background:
Figure 7.1: Running the jobs command after backgrounding two nano processes
The output shows that I have two 
nano
 sessions in use, one modifying 
file1.txt

and the other modifying 
file2.txt
. If I were to execute the 
fg
 command, that would 
bring up the 
nano
 session that's editing 
file2.txt
, since that was the last one I was 
working in. That may or may not be the one I want to return to editing, though. Since 
I have the job ID on the left, I can bring up a specific background process by using its 
ID with the 
fg
 command:
fg 1 
Knowing how to
 background a process can add quite a bit to your workflow. 
For example, let's say, hypothetically, that I'm editing a config file for a server 
application, such as Apache. While I'm editing this config file, I need to consult the 
documentation (man page) for Apache because I forgot the syntax for something. I 
could open a new shell and an SSH session to my server and view the documentation 
in another window. This could get very messy if I open up too many shells. It would 
be much simpler to background the current 
nano
 session, read the documentation, 
and then foreground the process with the 
fg
 command to return to working on it, all 
from one SSH session!
To background a process, you don't have to use 
Ctrl
 + 
z
; you can actually 
background a process right when you execute it by entering a command with the 
ampersand symbol (
&
) typed at the end. To show you how this works, I'll use 
htop
 
as an example. Admittedly, this may not necessarily be the most practical example, 
but it does work to show you how to start a process and have it backgrounded right 
away. We probably won't have 
htop
 installed yet, but for now feel free to install this 
package and then run it with the ampersand symbol:
sudo apt install htop 
htop & 


Chapter 7

Download 15,21 Mb.

Do'stlaringiz bilan baham:
1   ...   213   214   215   216   217   218   219   220   ...   482




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish