Difference between revisions of "Linux File System"

From FreekiWiki
Jump to navigation Jump to search
m (File System Hierarchy moved to Linux File System: its actually the Linux Filesystem Hierarchy but just Linux Filoe System makes more sense as it will also cover directories not in the LFH)
(No difference)

Revision as of 19:04, 9 March 2011

Linux File System

One of the joys of working with Linux/Unix is the regularity of the file system between machines. This has evolved alongside Unix and is now formalized in Linux as the Fileisystem Hierarchy Standard. It is maintained by the Linux Foundation and most distro's follow it, though they tend not to follow it completely. It is derived from the File System.

Standard Directories

The root or base directory, not to be confused with /root. This sits at the top of the tree and contains all the other folders --- Hence why /root begins with a /.
This contains the essential user binaries needed for single user mode (a.k.a Recovery mode). i.e. The programs you needed to get a broken system fixed. As well as the basic command line features such as ls and cp, it contains shells such as Bash, file, text and system manipulation utilities like kill,grep, " chmod, compression programs like gzip and some basic network utilities .

/boot ; boot loader files
contains the kernel etc. Very important but there is not much to do here except change grub settings and occasionally clean up old kernel versions. Sometimes, especially on older systems, it is on separate partition that can fill up and overflow, with strange and difficult to track down results.
True to the Everything is a File philosophy this is a way of representing all sytem devices as files. For example a CD player will show up as /dev/cdrom. This also contains special devices such as /dev/null the 'bit bucket' or black hole of Unix. Other examples include /dev/random and /dev/zero, for when you want a handy source of randomness or zeroes.
System wide configuration files. e.g. /etc/hostname which contains the systems hostname. As well as the files that contain system configuration files like /etc/networkor/etc/passwd, daemons/server software such as Apache or Samba store their configuration files here. User programs also store some of their configuration files here -- those that relate to system-wide defaults. Of particular note are the /etc/init.dand /etc/rc0.d to /etc/rc6.d directories, these control the startup and shutdown process. /etc/init.d contains scripts that can be used to stop and start different parts of the system such as networking and the different daemons installed (a daemon is a program that run in the background without user intervention these range from webservers to the log daemon.