Linux processes, init, fork/exec, ps, kill, fg, bg, jobs

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 ต.ค. 2024
  • Delve into the Linux process management system and see how everything fits together.
    Hope you enjoyed the video!
    Check out this code here:
    github.com/eng...
    Join my Discord server to chat with me:
    / discord
    Check out some code on my GitHub:
    github.com/ebr...
    Tweet me something funny on Twitter:
    / _engineerman
    Say hi over at Facebook:
    / engineermanyt
    Sincerely,
    Engineer Man

ความคิดเห็น • 249

  • @TheHermitHacker
    @TheHermitHacker 5 ปีที่แล้ว +196

    Been a linux user since 1995 but I still learned something. Thank you!

    • @EngineerMan
      @EngineerMan  5 ปีที่แล้ว +15

      Glad I could bring you some new knowledge!

    • @smudgepost
      @smudgepost 5 ปีที่แล้ว +2

      Same (1993) Still have trusty Using Linux Sixth Edition (QUE) on my desk..

    • @heXan
      @heXan 3 ปีที่แล้ว +1

      Same here since 1999... Only used kill with -1, -2, -9... fg and bg were new to me. But as a lazy dev I've used it from' top' (even better 'htop') or directly with 'xkill' - point and click style :).

  •  5 ปีที่แล้ว +45

    I don't think I ever hear such clear explanations. Thank you very much!
    Instead of using 'clear', you could use 'CTRL+L'.

    • @AbhishekBM
      @AbhishekBM 4 ปีที่แล้ว +11

      But it's not the same as clear. It just scrolls the current prompt to the top, you can still see the older commands when scrolling back up

    • @poorgirl9458
      @poorgirl9458 3 ปีที่แล้ว +5

      and when you go ‘set -o vi’ to enable vi mode at the bash prompt ‘ctrl-L’ does not work

  • @Hakusha
    @Hakusha 5 ปีที่แล้ว +57

    these linux videos are fantastic

  • @maxpolaris99
    @maxpolaris99 2 ปีที่แล้ว +4

    This was an excellent video that got me up to speed in a hurry.
    Very well organized and nicely explained.
    A great jumping off point for my own exploration.
    Thank you!

  • @MehdiShokoohi
    @MehdiShokoohi 5 ปีที่แล้ว +13

    That was amazing Engineer; wish i could 'fg' all of my postponed tasks and "kill -20 bad-mood" !

    • @ShivamJha00
      @ShivamJha00 5 ปีที่แล้ว +1

      Why not kill -9 it :D

    • @justChuka
      @justChuka 5 ปีที่แล้ว

      U mean 9?

  • @Diprotic
    @Diprotic 5 ปีที่แล้ว +4

    I'm 3 minutes in & I've learned A LOT!
    Thank you! You're the kind of people we need on youtube regarding linux.

  • @stargentitude7154
    @stargentitude7154 ปีที่แล้ว

    I am learning this at college, but everyone one is struggling due to our harsh teacher making the most hardest test questions. He does not give good material to study, but thank God I came across your channel. I finally understand the real purposes of these commands and enjoy this now!

  • @zachmane2
    @zachmane2 5 ปีที่แล้ว +1

    Always appreciate the quality of your videos. Goes in depth, but accessible to beginners

  • @fruitygranulizer540
    @fruitygranulizer540 2 ปีที่แล้ว +2

    this was so incredibly well explained. my prof was making a shit show out of this chapter by just throwing a bunch of words at us. going back and reading his lecture notes, i can understand it now, and i furthur can see how poorly written his lecture was. thank so much for this.

  • @bitelogger
    @bitelogger 4 ปีที่แล้ว +1

    I wish knew your name to properly address my thanks to you and this great video...The quality f your explanation but also the goodwill to share it with the community, my deep respect!!!

  • @freeuyghur2063
    @freeuyghur2063 5 ปีที่แล้ว +5

    11:54 We can use `watch -n 2 jobs` to monitor jobs command every 2 seconds.
    so we can show the realtime result from pane 1 when the process killed at pane 2.
    some energy efficiency and fun than manually type a repetitive command.

    • @brandon.duffany
      @brandon.duffany 3 ปีที่แล้ว

      Thanks for this awesome tip! This is a game-changer!

  • @IctioPar
    @IctioPar 5 ปีที่แล้ว +2

    Great content! I've recently started working with linux again and it's awesome to get to know more!

  • @ezequiel9055
    @ezequiel9055 5 ปีที่แล้ว +4

    I wonder what distro are you using since your 'kill -l' output is so different than mine. Yours is more complete and is numbered while mine is just a list of signals, completely useless.
    As usual great video, very well prepared and organized, and your communication skills are superb ;) you are a very good teacher. I've been a linux user since 1998 and still learning things.
    Very much appreciated.

    • @tpaq
      @tpaq 5 ปีที่แล้ว +2

      Most shells supply a "builtin" version of kill, try: "type kill". The presenter uses the Bash shell. I use Z-Shell, and its builtin is quite terse. try "/bin/kill -L".

  • @tigercake558
    @tigercake558 5 ปีที่แล้ว +5

    really love these videos, I'm learning a lot. Very very accessible and clear videos, please keep up the good work.

  • @kavithapriyacj4868
    @kavithapriyacj4868 ปีที่แล้ว

    Just a wow content .. awesome man that u indirectly mentioned about difference between killed and terminated process ..love u

  • @abhishekshah11
    @abhishekshah11 4 ปีที่แล้ว +1

    I'm happy that I recognized all the commands :)

  • @MiserableDuck95
    @MiserableDuck95 5 ปีที่แล้ว +94

    Where was this 3 months ago during my Operating Systems course?

    • @diggydude5229
      @diggydude5229 4 ปีที่แล้ว +4

      You're looking for W. Richard Stevens' books on UNIX programming, where all of this stuff is explained in detail.

    • @ChudLife
      @ChudLife 3 ปีที่แล้ว

      going through it right now in OS course and it is kicking my ass
      I feel like I am watching the Rockwell Retro Encabulator video

  • @justchecking2470
    @justchecking2470 3 ปีที่แล้ว +1

    your content is neat and tidy I can't be grateful more for what you've done on this channel. your contribution for linux learning community is huge

  • @yeeeehaaawbuddy
    @yeeeehaaawbuddy 2 ปีที่แล้ว

    These are very involved processes, but you explain it all so well, and in such a good order. Thanks!!

  • @TheFarmacySeedsNetwork
    @TheFarmacySeedsNetwork 5 ปีที่แล้ว

    The few videos of yours I've seen are excellent and simple explanations! I will be sharing these with my friends (who are learning) and also my users from my Raspberry Pi series. cheers!

  • @somber_soul
    @somber_soul 5 ปีที่แล้ว

    Very helpful. I've only ever seen htop for process management and this helps to understand the underlying signals being sent. Thanks!

  • @georgichelenkov4360
    @georgichelenkov4360 5 ปีที่แล้ว +1

    Great job! Recently found these series and am fascinated! Subscribed immediately! Keep up the good work!

  • @rushikmakwawna
    @rushikmakwawna 4 ปีที่แล้ว

    Very well explained. Keep uploading such videos. Sound clarity is really good.

  • @wramarante
    @wramarante 5 ปีที่แล้ว

    UNBELIEVABLE !!!...why??? Personally I have the habit to check the ratio dislike/like of all videos I intend to watch. I don't go around looking for higher or lower ratios, I just do it before watching it. That said, most of excelent videos I have watched has a ratio score between 1% and 3%. This video of yours has the impressively amazing ratio of 0.35% (5/1400)... You got a new susbscriber and a big fan on a 20 years linux admin.

  • @skyloreBOTS
    @skyloreBOTS 2 ปีที่แล้ว

    Dude props on how well you explain everything!

  • @zgredfryd
    @zgredfryd 3 ปีที่แล้ว

    Thank You man! I really like your videos. I know what those commands do, but Your explanation of what is really happening in Linux is golden! Yo have a gift to explain things and teach people. Great, great stuff. It's helping me a lot.

  • @aminebouaita9202
    @aminebouaita9202 3 ปีที่แล้ว

    I want to thank you for the quality of your videos, not just this one. All of your videos

  • @tdkiran
    @tdkiran 3 ปีที่แล้ว

    Thanks you for this video . Would like to see more on Linux/unix series

  • @aayyaa1188
    @aayyaa1188 4 ปีที่แล้ว

    You make the concept of these command so clear. Thank you soooo much

  • @gana706
    @gana706 3 ปีที่แล้ว

    Ctrl c sends a SIGINT signal.
    Init is the first process pid = 1
    Bash first fork (copies ) the process and than exec (replaces ) the process as child process.
    T = stopped state
    S = Interuptable sleep state ( Running in bg)
    Kill -15
    Kill -2
    Kill -1
    Kill -9 ( my fav )

  • @yangzhang2303
    @yangzhang2303 5 ปีที่แล้ว +3

    Really nice and clear. Would you like to make an video about using strace ?

  • @danielmoita6151
    @danielmoita6151 5 ปีที่แล้ว +4

    hey just started watching your videos and they have helped me a lot. i like they way you explain. Would you be willing to do a video explaining named pipes for server-client, using multithreading or select() for parallel requests? Thank your for your videos, and keep up the great work :)

  • @ZacKoch
    @ZacKoch 5 ปีที่แล้ว +16

    Great as usual!

  • @4932gb
    @4932gb 3 ปีที่แล้ว

    Been using unux since 1980 and linux sice 1995. This is good stuff!

  • @MichaelMantion
    @MichaelMantion 5 ปีที่แล้ว +1

    You are a life saver. You are exactly what I need right now. TY.

  • @bzielinski
    @bzielinski 5 ปีที่แล้ว

    Brilliant and simple explanation about kill signals. Thank you.

  • @josephemmanuel4089
    @josephemmanuel4089 3 ปีที่แล้ว

    Thank you. This really helps me for my current project

  • @alexanderradyuk9204
    @alexanderradyuk9204 5 ปีที่แล้ว

    Good job 👍🏻 The way you explain is awesome. Even knowing such things I continued watching. Keep it up!

    • @EngineerMan
      @EngineerMan  5 ปีที่แล้ว

      Thanks for the kind words, hope I helped in some way.

  • @lavellefloyd4639
    @lavellefloyd4639 5 ปีที่แล้ว

    I appreciate you sharing wisdom to linux noobs like myself

  • @patrykp8460
    @patrykp8460 2 ปีที่แล้ว

    after watching 15 sec I knew that this is proper and what I was actually looking for :D

  • @jorgediaz6730
    @jorgediaz6730 5 ปีที่แล้ว

    One thing I find very useful is having a process run outside of their parent process So For example if i run a long running process on the bash terminal I can exit the terminal and check on the process later on. You can do this with the screen command.

  • @qeithwreid7745
    @qeithwreid7745 5 ปีที่แล้ว

    You have taught me that kernel has parent ID of zero.
    This is the foundational level upon which I shall build many great things.

    • @Diprotic
      @Diprotic 5 ปีที่แล้ว

      It's a kernel like a popcorn kernel.

    • @qeithwreid7745
      @qeithwreid7745 5 ปีที่แล้ว

      Diprotic there is a grain of truth in that.

  • @mikefdorst
    @mikefdorst 5 ปีที่แล้ว

    Thanks man! You just upgraded my workflow.

  • @behruzm
    @behruzm 2 ปีที่แล้ว

    Excellent explanation of the above terms

  • @naveenagarwal287
    @naveenagarwal287 4 ปีที่แล้ว

    It's funny that kill can also bring a process to life as well.

  • @carlpilongo539
    @carlpilongo539 ปีที่แล้ว

    Thank you for teaching us Linux, Programmer Mrbeast

  • @prabodh11
    @prabodh11 3 ปีที่แล้ว +1

    Great video, Informative, thanks for sharing🙏

  • @v0idvlr1
    @v0idvlr1 2 ปีที่แล้ว

    Learned too much with this video, thanks too much man!

  • @leonardodavinci4259
    @leonardodavinci4259 ปีที่แล้ว

    Exactly what I needed. THANKS!

  • @RussTeeTrombone
    @RussTeeTrombone 5 ปีที่แล้ว

    Thanks so much for these videos. You’re truly a jack of all tech trades.

  • @photopicker
    @photopicker 4 ปีที่แล้ว

    That was amazingly clear and insightful.

  • @radubojica7888
    @radubojica7888 5 ปีที่แล้ว

    They took yerr jobs !!! Great video man btw. I learned some things from this which my Operating Systems teacher didn't teach me. :)

  • @pierrebouchard4289
    @pierrebouchard4289 5 ปีที่แล้ว

    Great video ... Learned a lot ... You're a gentleman and a scholar ...

  • @lawrencedoliveiro9104
    @lawrencedoliveiro9104 5 ปีที่แล้ว +7

    3:36 specifying ps options without a dash is BSD-style syntax. Probably best avoided.

  • @glikar1
    @glikar1 5 ปีที่แล้ว

    Superb clarity as usual!

  • @JTKroll12
    @JTKroll12 3 ปีที่แล้ว

    really love your videos I learned a lot of stuff about killing

  • @mybean1096
    @mybean1096 4 ปีที่แล้ว

    Processes are very powerful if you understand them. Theres this wonderful site called man7 that covers processes, daemons, and much much more. Theres also lots of IBM documentation on how to write a processe. Anyway thanks for the vid I haven't studied it in a while.

  • @bludblind
    @bludblind 5 ปีที่แล้ว

    Clear and concise information. Thank you!

  • @travelogue7960
    @travelogue7960 5 ปีที่แล้ว +37

    Hi Engineer Man,
    Have a series of videos on sed and awk commands..
    Thanks in advance..
    An Engineer

  • @MiseryFarm
    @MiseryFarm 5 ปีที่แล้ว

    I'm really enjoying these videos. Thanks

  • @isaacvv
    @isaacvv 5 ปีที่แล้ว

    Thanks for the videos. Keep them coming!

  • @xpkareem
    @xpkareem 5 ปีที่แล้ว

    I learn a lot from your videos. Thanks!

  • @natahmad84
    @natahmad84 3 ปีที่แล้ว

    Thanks dude, pretty clear and simple!

  • @lawrencedoliveiro9104
    @lawrencedoliveiro9104 5 ปีที่แล้ว +2

    3:05 Perhaps make it clearer by pointing out that the “exec” command is a bash builtin which tells it to skip the fork() call before running the rest of the line as the actual command.

  • @hostgrady
    @hostgrady 2 ปีที่แล้ว

    Very interesting, hopefully I can use these in shell scripts for something

  • @frroossst4267
    @frroossst4267 ปีที่แล้ว

    Super helpful, super concise, thanks!

  • @kapilsonyt
    @kapilsonyt 4 ปีที่แล้ว

    I have learned something new. Thanks much.

  • @bharatsnair
    @bharatsnair 3 ปีที่แล้ว

    Also check out pstree, which lets you view processes as a tree, helps you see the forks and execs.

  • @ForceHunterHD
    @ForceHunterHD 5 ปีที่แล้ว

    Great linux videos. I hope more are coming cuz i rly want to learn linux

  • @dadda-w3c
    @dadda-w3c ปีที่แล้ว

    thanks Mr.Beast for this very good explanation 😁😅

  • @athmikagowda6728
    @athmikagowda6728 3 ปีที่แล้ว

    Awesome vedio.....All linux users should have a look

  • @catorials444
    @catorials444 3 ปีที่แล้ว

    I love that mr. beast takes up software engineering.

  • @yura979
    @yura979 5 ปีที่แล้ว +5

    I would never expect young Che Guevara to make such good clean videos. Thanks.

  • @fontanot
    @fontanot 3 ปีที่แล้ว

    great video, you just earned another subscriber

  • @roeyleon22
    @roeyleon22 3 ปีที่แล้ว

    Very good explenation ! - subscribed :)

  • @bendover4728
    @bendover4728 5 ปีที่แล้ว

    Awesome! Where can I find more information like this? I wish to learn and have deep understanding of Linux functioning, commands, etc

  • @flakkanon
    @flakkanon 5 ปีที่แล้ว

    Nice video for recap as a linux user

  • @MrSURENDRAGAMEBOY
    @MrSURENDRAGAMEBOY 3 ปีที่แล้ว

    Better then my teacher :) awesome man

  • @davidrmcmahon
    @davidrmcmahon 3 ปีที่แล้ว

    I just like getting the uptime of my pi-hole and Jellyfin server Pi. Two weeks so far, hoping no power blackouts!

  • @jonassteinberg3779
    @jonassteinberg3779 5 ปีที่แล้ว

    well organized and delivered

  • @armandnouri8207
    @armandnouri8207 4 ปีที่แล้ว

    Great video.
    Why do different jobs listings appear for different bash log-in sessions?

  • @willb.755
    @willb.755 5 ปีที่แล้ว

    Great content as always! Thanks man :)

  • @MatthewStidham
    @MatthewStidham 5 ปีที่แล้ว

    That was a killer video. Thanks!

  • @Didanihaaaa
    @Didanihaaaa 5 ปีที่แล้ว +2

    thanks for such a great channel. I heard about parallel computing on Linux. could you please teach us some parallel computing stuff? bests

  • @unstoppable-ar3292
    @unstoppable-ar3292 4 ปีที่แล้ว

    Very good. Thanks man. Legend!!!

  • @SubiqT
    @SubiqT 2 ปีที่แล้ว

    Excellent explanations, thanks a lot

  • @ag.4937
    @ag.4937 4 ปีที่แล้ว

    Brilliant explanation, Thanks

  • @samkachar
    @samkachar 3 ปีที่แล้ว

    Learned alot about killing

  • @peacemaker42069
    @peacemaker42069 5 ปีที่แล้ว

    hey man, great video,can you recommend any books or websites for learning linux/unix

  • @Cray2TheZ
    @Cray2TheZ 5 ปีที่แล้ว

    Brilliant video! Thanks!

  • @dushyanthpeddi9690
    @dushyanthpeddi9690 5 ปีที่แล้ว

    Great stuff. Thanks for this video.

  • @dast6915
    @dast6915 5 ปีที่แล้ว

    Well I didn't know that. Great content. I will have to look at your other videos now. And subcribe!

  • @adamnshame
    @adamnshame 5 ปีที่แล้ว +2

    FYI It is possible for "kill -9" to fail.
    If it does, the disk is probably full.

    • @rishko2224
      @rishko2224 5 ปีที่แล้ว

      Or it's waiting for an io operation. It happened to me on a networked drive

  • @nidishmodala3638
    @nidishmodala3638 5 ปีที่แล้ว

    thank you so much for clear explanation

  • @ajiththiyar7609
    @ajiththiyar7609 5 ปีที่แล้ว +2

    This is so helpful thank you man, keep it up.

  • @braulioramirez3463
    @braulioramirez3463 5 ปีที่แล้ว

    EM great informational tutorial. I have a simple question though, why would you want to run a process in the BG to regain control of the terminal when you could simply just open another terminal window? I guess without a GUI you'd be forced to run one terminal window at a time.
    What are your thoughts?

    • @EngineerMan
      @EngineerMan  5 ปีที่แล้ว

      One reason would be the save time, another reason would be if you start everything in the same terminal, they all have the same PPID and that would allow you to more easily kill a bunch of processes if necessary. It all depends on use case. Certainly using a ton of terminal windows is fine too (I do this).

    • @lawrencedoliveiro9104
      @lawrencedoliveiro9104 5 ปีที่แล้ว

      Another reason is that you might be using a remote terminal connection to another machine, and you need (or prefer) to do all your operations through that single terminal window. Actually in this situation screen can be useful for doing multiple things at once in the remote end.
      And yet another reason is that you want to run multiple background commands and monitor the progress of them all in a single window. E.g. something like
      download-file-1 & download-file-2 & download-file-3 &
      then you get all these running progress displays overlapping in the same window.

    • @braulioramirez3463
      @braulioramirez3463 5 ปีที่แล้ว

      @@lawrencedoliveiro9104 Thank you, Lawrence, for this explanation -BR (aka buong10rn0@discord)

  • @HK-sw3vi
    @HK-sw3vi 2 ปีที่แล้ว

    you sigkilled it with this video. fantastic!

  • @radiotriggered2096
    @radiotriggered2096 5 ปีที่แล้ว +4

    Ey, this is about init, innit?
    Bwhahahaha, I crack myself up :-D :-/

  • @diggydude5229
    @diggydude5229 4 ปีที่แล้ว

    I don't believe a forked child process returns to the parent. The two processes run concurrently, and the child emits a SIGCHLD signal when it completes. The parent will have a signal handler that tells it what to do when it receives SIGCHLD, for example display a message that the child has stopped.

  • @braulioramirez3463
    @braulioramirez3463 5 ปีที่แล้ว

    One last thing EM, could you do some videos about HTML/XML, website hosting (using dynamic DNS for instance), etc.? I have some javascript projects I would like to share with everyone but first I need to know how to create a web server to host my very own website, (possibly a VM version of a recommended Linux distro). This could start as a barebone, text editor-based level HTML/XML code tutorial. I'm sure not everyone knows how to write HTML/XML code so a tutorial would be useful! As markup language continues to evolve, understanding the basics and comparing it with the way many browsers use this code would be very educational. As always, thank you so much for sharing your knowledge with this community.

    • @EngineerMan
      @EngineerMan  5 ปีที่แล้ว

      I actually did a live stream on this. Check for my livestream that has a title like "getting that sweet website of yours online".