Unix Directory Structure
Unix Directory Structure
Unix Directory Structure
The UNIX operating system is made up of three parts; the kernel, the shell and the programs.
The Kernel The kernel of UNIX is the hub of the operating system: it allocates time and memory to programs and handles the filestore and communications in response to system calls. Shell and Kernel work together Example :%rm myfile Shell searches for file which containing program rm . Requests Kernel , through system call to execute rm on myfile. When finished control returns to shell prompt. Waiting for commands The Shell Shell is a interface between user and kernel. It is a CLI
/ (root) -- The / notes the "root" of the filesystem, where the entire system is contained. Unix holds the entire system in this single top-level directory, including each device and document. In Unix, "everything is a file. /bin -- Stands for "binaries"; Contains fundamental utilities needed by a system administrator. As a failsafe, these were placed in a separate directory so that they could be placed on a separate disk or disk partition in case the main drive failed. /etc -- Contains configuration files and some system databases.
/dev -- short for devices. Contains file representations of every peripheral device attached to the system. /dev/null -- Also known as the "bit bucket" or "black hole", this virtual file discards all contents written to it. This is typically used to throw away unwanted data streams, such as log files. /dev/random -- This is a virtual file which contains random numbers /home -- contains the home directories for the users. On some Unices, this is under /usr/home /mnt -- This is the default location to mount external devices like hard disk drives, pen drives etc. /lib -- This is the depository of all integral UNIX system libraries. /root -- the home directory for the superuser root. /tmp -- a place for temporary files. Many Unices clear this directory upon start up. /usr -- originally the directory holding user home directories, its use has changed, and it now holds executables, libraries, and shared resources that are not system critical/usr/bin -- This directory stores the executables that live in /usr. /usr/include -- /usr/include stores the development headers used throughout the system. /usr/lib -- The required libraries for executables within /usr or elsewhere for that matter, live here. /var -- short for "variable." A place for files that may change often, such as the storage to a database, the contents of a database, log files (usually stored in /var/log), email stored on a server, etc. /var/log/ -- Storage for the system log files. /var/mail/ -- the place where all the incoming mails are stored. The user can access his/her own mail only unless he/she has admin rights. /var/spool/ -- contains print jobs, mail spools and various other tasks that have been queued , waiting for some related task to finish.
File Types
Run Levels
# init 0 #init 6
-- Shutdown --Reboot
Commands
# man command #whatis command #apropos Search Pattern #passwd #who #w #script #uname #date #cal #bc #echo #clear #which #history