Linux Directories

Linux has a directory structure which can be a little confusing. Here’s a basic description of it.

/ – the root directory

/bin – binary executable commands like ls

/boot – the linux kernel and stuff for the linux loader and grub

/cdrom – permanent mount for cdrom

/dev – attached devices like serial ports

/etc – miscellaneous configuration files and initialization scripts for the system

/home – the home directories for all the users of the system

/lib – library files for programs

/lost+found – lost files

/media – folder for mounted media devices. The cdrom can be mounted here, but is usually the /cdrom directory now

/mnt – folder for temporarily mounted devices

/opt – storage for large programs

/proc – running process information

/sbin – executable commands used for administration and so more secure

/srv – internet server information

/sys – linux kernel system devices information

/tmp – user available temporary directory flushed when booting

/usr – sub-directory for online manual

/usr/X11R6 – X Windows System

/usr/bin – an extended user collection of executable binary programs

/usr/lib – extended user library collection for C and C++ programs, Python programs, etc.

/usr/local – this is where binary executable programs should be that you compile yourself

/usr/share – shared data for programs among all users. A lot of configuration files for applications will be here.

/usr/share/man – the manual/help files for your system

/usr/src – the source code for the linux kernel

/var – various system files including logs and files for a web server or FTP server

/var/cache – cached data for programs

/var/lib – information for current program states

/var/lock – locked files so a file is only used by one program at a time

/var/log – log files

/var/mail – mailbox

/var/opt – variable data for packages

/var/run – data since booting

/var/spool – spooled data

/var/tmp – temporary data preserved between booting sessions

/var/yp – files for NIS (network information service) database