In this topic we investigate the file structure in Linux and begin to understand the where are why data is stored in specific locations in Linux. Essentially, the filesystem is broken down in to data that needs to be read, read and executed and data that need to be written to. This then provides us with the /var directory which will store variable data, or data that includes areas that need to be written to. So we have the /var/log directory for log files, the /var/spool directory for print spools, mail, scheduled job. Exutable content will include the /bin, /sbin and for shared library file the /lib directories. These are replicate additionally under /usr/.
Being for required programs for the OS and have to be part of the root filesystem
These being additional or non-required programs that can be partitioned separately to the root filesystem. In the /lib directory we will find shared modules code libraries used by progrem with the .so extension and kernel modules, drivers loadable by the kernel with .ko extentions.
The program ldd can show you shared Libraries required by a program, ldd /usr/bin/passwd and lsmod can show currently loaded kernel modules.