Linux Crash Course: Background (bg) and Foreground (fg)

  Рет қаралды 20,855

Learn Linux TV

Learn Linux TV

Күн бұрын

Пікірлер: 55
@roymisgbs
@roymisgbs 2 жыл бұрын
The information here is incomplete, if not misleading. Ctrl + Z is not used to simply background a job and it is significantly different from adding '&' at the end of a command. This guy probably knows it cz he is definitely an expert judging by all his other videos, but was too lazy to explain perhaps:- ----> SUSPEND a job (pause) and send to background & ----> Send to background (but keep it in RUNNING STATE, unpaused) so if you want your already running job to go to background and STAY RUNNING, you have to do the following 2 things: 1. Press Ctrl + Z to suspend the job temporarily and send to background, and still be on the terminal 2. typing next command --> bg ---> this keeps the job in the background but additionally resumes it, and you are still on the terminal. (to know the job ID number you can always run the 'jobs' command) This doesnt matter either ways if you are "backgrounding a text file edit" etc lol, but it DEFINITELY MATTERS when you are running a server in the background! Please like my comment to show love
@TheGacko
@TheGacko 2 жыл бұрын
hah - yes very misleading ... lol I was just on a job showing a guy to ctrl-z a task to gzip this massive file so we could carry on monitoring system .. well .. suffice to say -- today I learned I would suggest Jay really should do a followup -- a good test/exercise is to go through using the sleep command and ctrl-z then bg then keep stacking up some sleep commands in the background and see that they finish as they should etc. also need to cover the standard output .. and perhaps send output to file for a background running task so its not writing to the current standard out etc.
@manny8717
@manny8717 3 жыл бұрын
I was curious to know what the + and - mean after the job ID so I did ‘man jobs’ and it looks like they’re just last and second to last respectively. I guess not too important but good to know. Loving these videos. Thank you so much, Jay!
@Ancientreapers
@Ancientreapers 3 жыл бұрын
Ah and what's that number after Example:@8:18 [2] 4760 @9:10 [3] 4762 when one sends the app directly to the bg. I haven't looked it up yet. I'm going to guess the 4760 and 4762 are the byte sizes of the file?
@Ancientreapers
@Ancientreapers 3 жыл бұрын
Well I was wrong it's the process id. The output includes the job number, process ID
@BehzodSabirov
@BehzodSabirov 3 жыл бұрын
Jay's lecture plus this - and my day is definitely done. Thumbs up
@YugoGautomo
@YugoGautomo Жыл бұрын
@@Ancientreapers yes it process id. you could get the process number using `ps` command.
@ultradude5410
@ultradude5410 3 жыл бұрын
I love LLTV. Every video is clear and informative, but Jay still takes the time to cover the less flashy / less interesting yet still important stuff that most channels don’t bother explaining.
@DaveThompson_RocksLinux
@DaveThompson_RocksLinux 3 жыл бұрын
Brother, that was well done. I've never thought of backgrounding as desktop process management. Very cool.
@fadi_mousa
@fadi_mousa 3 жыл бұрын
You can uncomment set suspendable in /etc/nanorc file to enable suspension with ctrl+Z for nano
@sametcoban1604
@sametcoban1604 9 ай бұрын
I have been following Jay for a while and really find your videos helpful. I purchased your book on mastering Ubuntu server and watching videos in tandem. Thanks for sharing all these and keep up the good work.
@luisrosal1322
@luisrosal1322 3 жыл бұрын
This channel is getting better by the minute!! Thanks Jay.
@dagamore
@dagamore 3 жыл бұрын
Great explanation of FG, sounds like a tool I need to be using more than I am, Thanks.
@asaskald
@asaskald 3 жыл бұрын
All this time I didn't know the jobs command. Thanks Jay!
@synen
@synen 3 жыл бұрын
what about bg is that a command too?
@AlexDresko
@AlexDresko 2 жыл бұрын
This clears up so many questions I've had.
@Felix-ve9hs
@Felix-ve9hs 3 жыл бұрын
I just wanted to see what the video was about and ended up watching the entire thing to the end :D
@michaeldina1103
@michaeldina1103 3 жыл бұрын
I always thought the best way to do this is with a multiplexer. This seems a lot more practical in some situations. Thanks!
@DL-xf3ur
@DL-xf3ur 2 жыл бұрын
Thank you Jay! Awesome as always!
@chuckflowers5448
@chuckflowers5448 3 жыл бұрын
I would assume it's related to making nano approachable for people new to the terminal. I imagine most beginners would associate Ctrl+Z with undo and might find themselves with a bg nano process and not know how to recover it.
@ShinyTechThings
@ShinyTechThings 3 жыл бұрын
Looks like I'm first! 😎
@bkrich
@bkrich 3 жыл бұрын
Great info, I see this helpful if you’re at a console and need to do multiple things. I guess with any modern Linux desktop you probably would use tabs but bf and fg is certainly helpful to know
@unbekannter_Nutzer
@unbekannter_Nutzer 3 жыл бұрын
It is most useful if you do remote login via ssh to a terminal, and don't want to fire up a new xterm locally, to connect a second time to the same server. Or you started preparing some work in a terminal, went to a sub-sub-sub-dir, made new subdir, now you fired up a graphical program like geany or eclipse, but then you realize, you have 1 or 2 more things to do in the shell. Open another terminal and traverse the long path? No. Ctrl-Z, bring the graphic program to a stop, then bg, keep it running but don't have the starting shell been blocked.
@Randomizer92mx
@Randomizer92mx 3 жыл бұрын
Mah boi thanks for the tutorial!
@JohnBortins
@JohnBortins 3 жыл бұрын
Outstanding!
@m.j1436
@m.j1436 3 ай бұрын
This command is amazing
@Carlos-kv6hx
@Carlos-kv6hx Жыл бұрын
Wish I knew about this sooner. Im over here going back and fourth with VIM for no reason.
@RoadRunner1980
@RoadRunner1980 3 жыл бұрын
This was great! I never heard of this.
@robwoolf6872
@robwoolf6872 Жыл бұрын
What happens if I have something backgrounded and my putty session to a server times out please?
@igor.pasternak
@igor.pasternak 2 жыл бұрын
Amazing explanation! Thanks
@monolofiminimal
@monolofiminimal 3 жыл бұрын
I use this and screen, it's real handy.
@nathairsgiathach3728
@nathairsgiathach3728 2 жыл бұрын
Thanks man, great explanation!
@LearnLinuxTV
@LearnLinuxTV 2 жыл бұрын
Glad it helped!
@shlomobelleli2556
@shlomobelleli2556 3 жыл бұрын
Excellent video
@midnitemonty
@midnitemonty 3 жыл бұрын
I use VI / VIM alot.. "screen" is also a nice tool to bury and recall terminal sessions.
@alexgubin78
@alexgubin78 3 жыл бұрын
Thanks a lot for this video ;-)
@gokiburijin8478
@gokiburijin8478 3 жыл бұрын
Thank you!!!!
@13thravenpurple94
@13thravenpurple94 2 жыл бұрын
Great work Thank you
@nokkeli
@nokkeli 3 жыл бұрын
Finally ! A way to get out of Vim!
@andrewlhoover
@andrewlhoover 3 жыл бұрын
Very Useful!
@HaiNguyen-ot6xu
@HaiNguyen-ot6xu 3 жыл бұрын
Video on tmux and mosh please!
@udayarpandey3937
@udayarpandey3937 3 жыл бұрын
Hello Jay..waiting for the remaining Proxmox videos. :)) Thank you
@LearnLinuxTV
@LearnLinuxTV 3 жыл бұрын
Editing now! Sorry for the delay. They're coming. 😀
@d00dEEE
@d00dEEE 3 жыл бұрын
You need 'disown', too, so you can log out the shell and leave the process running...
@wesgould1
@wesgould1 3 жыл бұрын
or "nohup" --which does the same thing if you know you will be backgrounding a processing (and closing the shell/logging out) before you start it.
@evodefense
@evodefense Жыл бұрын
thx
@noceuclyde9345
@noceuclyde9345 2 жыл бұрын
very usefull !
@milosgajic23
@milosgajic23 3 жыл бұрын
nice!
@billykeed3609
@billykeed3609 3 жыл бұрын
cool commands
@weedeater64
@weedeater64 3 жыл бұрын
/etc/nanorc to fix then background fuckery in nano. Un-comment the bind line. ##If you want to suspend nano with one keystrok (instead of with ^T^Z): # bind ^Z suspend main
@sethmoreschi7475
@sethmoreschi7475 11 ай бұрын
Well, there you have it, why Steve Jobs wanted Unix/Linux as an operating system.
@KeithWhittingham
@KeithWhittingham 2 жыл бұрын
It's a bit of a shame that bg wasn't better combined with exit so that exit did the same as fg if there were jobs running
@_den_
@_den_ 3 жыл бұрын
I almost forgot about it, because I use screen
@Ranblv
@Ranblv 3 жыл бұрын
mint does not seem to mind backrounding nano edits
Linux Crash Course - Bash Aliases
17:58
Learn Linux TV
Рет қаралды 26 М.
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 61 МЛН
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН
“Don’t stop the chances.”
00:44
ISSEI / いっせい
Рет қаралды 62 МЛН
Linux Crash Course - The df and du Commands
20:28
Learn Linux TV
Рет қаралды 31 М.
Background and foreground processes
10:10
CodeVault
Рет қаралды 24 М.
Get Any App on Any Distro Easily
26:27
The Linux Cast
Рет қаралды 26 М.
Linux Crash Course - Understanding Memory and Swap Usage
20:55
Learn Linux TV
Рет қаралды 52 М.
How to Interpret Load Average in Linux (Linux Crash Course Series)
15:23
Linux Crash Course - sudo
26:11
Learn Linux TV
Рет қаралды 73 М.
Wubuntu, the Dubious Linux Windows
15:22
Action Retro
Рет қаралды 500 М.
Linux Crash Course - Data Streams (stdin, stdout & stderr)
17:13
Learn Linux TV
Рет қаралды 59 М.
Linux processes, init, fork/exec, ps, kill, fg, bg, jobs
13:47
Engineer Man
Рет қаралды 174 М.
5 Reasons You Should Use Distrobox
20:55
The Linux Cast
Рет қаралды 26 М.
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 61 МЛН