Reputation: 94
Can some one provide me a detailed description of what happens when you execute the "ls" command in linux. What system calls are used? What does the file system do? Obviously depending on which file system is used. Is someone can provide an in depth discussion on this topic or point me to some good resources that would be great! Thanks!
Upvotes: 1
Views: 3226
Reputation: 153
ls='ls --color=auto'
/bin/ls
fork()
) new process and execs it's code (exec()
). Process env is inherited from parent process to new "ls" process.ldd /bin/ls
)strace
, and the main part I believe are openat()
and getdents()
first opens directory and second reads entries inside there.wait()
signal and parent process bash terminates it completely.Upvotes: 1
Reputation: 1353
PWD
, eg /foo/bar and excute (/usr/bin/ls /foo/bar) Upvotes: 0