Linux directory structure: /lib explained
We already explained other important system folders like /bin, /boot, /dev, /etc etc folders in our previous posts. Please check below links for more information about other stuff which you are interested. In this post, we will see what is /lib folder all about. Linux Directory Structure explained: /bin folder Linux Directory Structure explained: /boot folder Linux Directory Structure explained: /dev folder Linux Directory Structure explained: /etc folder Linux Directory Structure explained: /lost+found folder Linux Directory Structure explained: /home folder What is /lib folder in Linux? The lib folder is a library files directory which contains all helpful library files used by the system. In simple terms, these are helpful files which are used by an application or a command or a process for their proper execution. The commands in /bin or /sbin dynamic library files are located just in this directory. The kernel modules are also located here. Taken an example of executing pwd command. It requires some library files to execute properly. Let us prove what is happening with pwd command when executing. We will use the strace command to figure out which library files are used. Example: root@linuxnix:~# strace -e open pwd open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3 open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3 /root +++ exited with 0 +++ root@linuxnix:~# If you observe, We just used open kernel call for pwd command. The pwd...
Read More