This section is about a quick overview of which directory and file is where so you know where to start.
It normally looks like an inverted tree with its roots on top and branches hanging below (don’t worry if you cant understand this. Get through to the end, for sure you will).
Just like a tree, we have a root from which everything else is attached. It is normally denoted by a forward slash “/”. Remember when we were installing the Linux disto Elementary-OS we created a partition and mounted is on to “/”. Allow me to call any other directory below this root its “children”
The root has many standardized children which you will find in all your distros:
- /bin >Essential command binaries
- /boot >Static files of the boot loader
- /dev >Device files
- /etc >Host−specific system configuration
- /lib >Essential shared libraries and kernel modules
- /media >Mount point for removable media
- /mnt >Mount point for mounting a filesystem temporarily
- /opt >Add−on application software packages
- /sbin >Essential system binaries
- /srv >Data for services provided by this system
- /tmp >Temporary files
- /usr >Secondary hierarchy
- /var >Variable data
Lets discuss these children one by one:
/bin: This contains essential command binaries and no directory is not allowed in it as a standard. The commands are essential and in case a system fails and the computer is not able to mount or access any network services, the commands can be used to troubleshoot the machine.
/boot: Contains all files needed to boot the computer. Its contents rarely change.
/dev: Contains block and character devices e.g hard disk, printer, mouse. Everything in Linux is a file; you can locate your partitions as /dev/sda1 (where “a” and 1 can be any number/letter). This files are populated by the Linux Kernel in real time. These are my disks:
Note: you cannot access your partitions from here, leave this to your kernel. We will use /media or /mnt to access our partitions.
/etc: This is for machine/host specific configurations. Generally no binary files exist inside this directory. Remember when we automounted our partitions we used the configuration file /etc/fstab
/lib: Binaries found in /bin and /sbin often use shared libraries located in /lib. You might also notice two directories /lib32 and /lib64. This was brought about so as to separate 64bit libraries and 32bit ones.
/media: Used to mount our partitions and also removable devices are automatically mounted here in some distros e.g Ubuntu. Once again remember our partition auto-mounting tutorial where we used /media/MUVI to mount our partition.
/mnt: It is advisable that the /mnt directory should be empty and should only be used for temporary mount points.
/opt: Its used to store optional software. In many cases this is software from outside the distribution repository. One time I installed Linux package for my broadband orange modem, it was installed under this directory.
/sbin: contains binaries that are used to configure the operating system. It should contain only binaries essential for booting, restoring, recovering, and/or repairing the system in addition to the binaries in /bin.
/srv: Used for data severed by your system e.g /srv/sales/www for serving www data for the sales department.
/tmp: Applications and users are supposed to use this to store temporary data. It is usually cleared on shutdown by some distros.
/home: This usually contains user data. If my user name is tux then a directory is created under /home/tux which contains my data and configuration files.
/root: This is the home directory for the root user.
To sum it all up: (picture by tuxradar)
##
Any question? As usual feel free to ask, will be more than glad to help…..
Or just send me an inbox at tuxygeek at gmail dot com