Difference between revisions of "Linux File System"

From FreekiWiki
Jump to navigation Jump to search
Line 6: Line 6:
 
; / : The root or base directory, not to be confused with <code>/root</code>. This sits at the top of the tree and contains all the other folders --- Hence why <code>/root</code> begins with a /.
 
; / : The root or base directory, not to be confused with <code>/root</code>. This sits at the top of the tree and contains all the other folders --- Hence why <code>/root</code> begins with a /.
  
; /bin : 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 <code>ls</code> and <code>cp</code, it contains shells such as Bash, file, text and system  manipulation utilities like <code>kill</code>,<code>grep</code>,  &quot;  <code>chmod</code>, compression programs like gzip and some basic network utilities .
+
; /bin : 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 <code>ls</code> and <code>cp</code>, it contains shells such as Bash, file, text and system  manipulation utilities like <code>kill</code>,<code>grep</code>,  &quot;  <code>chmod</code>, 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, which can cause of a lot of problems, that can appear seemingly unexplicable until you track them down.  
+
;/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.
 +
 
 +
;/dev : 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 <code>/dev/cdrom</code>. This also contains  special devices such as <code>/dev/null</code> the 'bit bucket' or black hole of Unix. Other examples include <code>/dev/random</code> and <code>/dev/zero</code>, for when you want a handy source of randomness or zeroes.
 +
 
 +
; /i./etc : System wide configuration files. e.g. <code>/etc/hostname</code> which contains the systems hostname. As well as the files that contain system configuration files like <code>/etc/network</code>or<code>/etc/passwd</code>, 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 <code>/etc/init.d</code>and <code>/etc/rc0.d</code> to <code>/etc/rc6.d</code> directories, these control the startup and shutdown  process. <code>/etc/init.d</code> 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.
 
[[Category: Tech support]] [[Category: Education]] [[Category: Tech training]]
 
[[Category: Tech support]] [[Category: Education]] [[Category: Tech training]]

Revision as of 19:52, 8 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 /.
/bin
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.
/dev
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.
/i./etc
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.