What happens when you type a command in the terminal?

Поділитися
Вставка
  • Опубліковано 28 січ 2025

КОМЕНТАРІ • 12

  • @jsagar1987
    @jsagar1987 2 роки тому +2

    Underrated in terms of likes. Really worth it for all the details you shared flawlessly.

  • @ship2nip
    @ship2nip 7 років тому

    great video !! thanks a lot for posting this

  • @DHARMiLSANGHVI
    @DHARMiLSANGHVI 3 роки тому

    Amazing video ! Can you please tell me what terminal is this that you are using?

  • @GaneshManika
    @GaneshManika 4 роки тому

    Nice. Thank you!!

  • @sweetness583
    @sweetness583 Рік тому

    Why does fork() create a copy of the currently running process? That seems unnecessary.

    • @tashian
      @tashian  Рік тому

      What do you mean by unnecessary?

    • @sweetness583
      @sweetness583 Рік тому

      @@tashian Why wouldn't the computer just reserve memory for the program and then run it? What if you were running a big process and need to call a simple one? It's going to copy the whole process first? That seems wasteful.

    • @tashian
      @tashian  Рік тому

      @@sweetness583 It's a great question. Forking a process is efficient and requires very few resources, due to the way memory management works on most computers. Look up "copy-on-write memory management" for more details.

    • @sweetness583
      @sweetness583 Рік тому

      @@tashian Oh ok. Thanks, I will look that up.

  • @PurnachandMedisetty
    @PurnachandMedisetty 3 роки тому

    do parent and child processes both write to the same fd1,fd2 concurrently?
    sorry, not an expert here. let me ask that little differently
    after exec() and replacing current shell program with some other program like echo with args "foo"
    echo writes $1 to stdout. so do I start to see "foo" getting displayed on terminal right here even before child exits?

    • @tashian
      @tashian  3 роки тому

      Yeah! Try it and see. Both programs will have the same fd0, 1, and 2. One thing bash handles is redirection, by modifying the file descriptors for the child before exec() is called.

  • @_AnuragsinghThakur
    @_AnuragsinghThakur 7 місяців тому

    ah aha ah aha aha ahahahahahaahha