Sie sind auf Seite 1von 3

Linux directory structure explained

I thought some people might like this. Remembering what all the default directories in Linux are for, can be hard at first. Here is a little “cheat sheet” that shows the Linux directory structure.

“cheat sheet” that shows the Linux directory structure. / – Root Every single file and directory

/ – Root

Every single file and directory starts from the root directory.that shows the Linux directory structure. / – Root Only root user has write privilege under

Only root user has write privilege under this directory.single file and directory starts from the root directory. Please note that /root is root user’s

Please note that /root is root user’s home directory, which is not same as /.Only root user has write privilege under this directory. /bin – User Binaries Contains binary executables.

/bin – User Binaries

Contains binary executables.directory, which is not same as /. /bin – User Binaries Common linux commands you need

Common linux commands you need to use in single-user modes are located under this directory.as /. /bin – User Binaries Contains binary executables. Commands used by all the users of

Commands used by all the users of the system are located here.use in single-user modes are located under this directory. For example: ps, ls, ping, grep, cp.

For example: ps, ls, ping, grep, cp.used by all the users of the system are located here. /sbin – System Binaries Just

/sbin – System Binaries

Just like /bin, /sbin also contains binary executables.example: ps, ls, ping, grep, cp. /sbin – System Binaries But, the linux commands located under

But, the linux commands located under this directory are used typically by system aministrator, for system maintenance purpose.Just like /bin, /sbin also contains binary executables. For example: iptables, reboot, fdisk, ifconfig, swapon /etc

For example: iptables, reboot, fdisk, ifconfig, swaponby system aministrator, for system maintenance purpose. /etc – Configuration Files Contains configuration files

/etc – Configuration Files

Contains configuration files required by all programs.reboot, fdisk, ifconfig, swapon /etc – Configuration Files This also contains startup and shutdown shell scripts

This also contains startup and shutdown shell scripts used to start/stop individual programs.Files Contains configuration files required by all programs. For example: /etc/resolv.conf, /etc/logrotate.conf

For example: /etc/resolv.conf, /etc/logrotate.confrequired by all programs. This also contains startup and shutdown shell scripts used to start/stop individual

/dev – Device Files

Contains device files./dev – Device Files These include terminal devices, usb, or any device attached to the system.

These include terminal devices, usb, or any device attached to the system./dev – Device Files Contains device files. For example: /dev/tty1, /dev/usbmon0 /proc – Process Information Contains

For example: /dev/tty1, /dev/usbmon0terminal devices, usb, or any device attached to the system. /proc – Process Information Contains information

/proc – Process Information

Contains information about system process./dev/tty1, /dev/usbmon0 /proc – Process Information This is a pseudo filesystem contains information about

This is a pseudo filesystem contains information about running process. For example:Information Contains information about system process. /proc/{pid} directory contains information about the process

/proc/{pid} directory contains information about the process with that particular pid.

This is a virtual filesystem with text information about system resources. For example: /proc/up- timeinformation about the process with that particular pid. /var – Variable Files var stands for variable

/var – Variable Files

var stands for variable files.For example: /proc/up- time /var – Variable Files Content of the files that are expected to

Content of the files that are expected to grow can be found under this directory.time /var – Variable Files var stands for variable files. This includes — system log files

This includes — system log files (/var/log); packages and database files (/var/lib); emails (/var/mail); print queues (/var/spool); lock files (/var/lock); temp files needed across reboots (/var/tmp);that are expected to grow can be found under this directory. /tmp – Temporary Files Directory

/tmp – Temporary Files

Directory that contains temporary files created by system and users.needed across reboots (/var/tmp); /tmp – Temporary Files Files under this directory are deleted when system

Files under this directory are deleted when system is rebooted.that contains temporary files created by system and users. /usr – User Programs (Unix System Resources)

/usr – User Programs (Unix System Resources)

Also known as short for “Unix System Resources”is rebooted. /usr – User Programs (Unix System Resources) Contains binaries, libraries, documentation, and source-code

Contains binaries, libraries, documentation, and source-code for second level programs.Also known as short for “Unix System Resources” /usr/bin contains binary files for user programs. If

/usr/bin contains binary files for user programs. If you can’t find a user binary under /bin, look under /usr/bin. For example: at, awk, cc, less, scpdocumentation, and source-code for second level programs. /usr/sbin contains binary files for system administrators.

/usr/sbin contains binary files for system administrators. If you can’t find a system binary under /sbin, look under /usr/sbin. For example: atd, cron, sshd, useradd, userdellook under /usr/bin. For example: at, awk, cc, less, scp /usr/lib contains libraries for /usr/bin and

/usr/lib contains libraries for /usr/bin and /usr/sbin/usr/sbin. For example: atd, cron, sshd, useradd, userdel /usr/local contains users programs that you install from

/usr/local contains users programs that you install from source. For example, when you install apache from source, it goes under /usr/local/apache2/usr/lib contains libraries for /usr/bin and /usr/sbin /home – Home Directories Home directories for all users

/home – Home Directories

Home directories for all users to store their personal files.it goes under /usr/local/apache2 /home – Home Directories For example: /home/john, /home/brian /boot – Boot Loader

For example: /home/john, /home/briandirectories for all users to store their personal files. /boot – Boot Loader Files Contains boot

/boot – Boot Loader Files

Contains boot loader related files.example: /home/john, /home/brian /boot – Boot Loader Files Kernel initrd, vmlinux, grub files are located under

Kernel initrd, vmlinux, grub files are located under /boottheir personal files. For example: /home/john, /home/brian /boot – Boot Loader Files Contains boot loader related

For example: initrd.img-2.6.32-24-generic, vmlinuz-2.6.32-24-generic/lib – System Libraries Contains library files that supports the binaries located under /bin and

/lib – System Libraries

Contains library files that supports the binaries located under /bin and /sbinvmlinuz-2.6.32-24-generic /lib – System Libraries Library filenames are either ld* or lib*.so.* For example:

Library filenames are either ld* or lib*.so.*that supports the binaries located under /bin and /sbin For example: ld-2.11.1.so, libncurses.so.5.7 /opt –

For example: ld-2.11.1.so, libncurses.so.5.7/bin and /sbin Library filenames are either ld* or lib*.so.* /opt – Optional add-on Applications opt

/opt – Optional add-on Applications

opt stands for optional.libncurses.so.5.7 /opt – Optional add-on Applications Contains add-on applications from individual vendors. add-on

Contains add-on applications from individual vendors.– Optional add-on Applications opt stands for optional. add-on applications should be installed under either /opt/

add-on applications should be installed under either /opt/ or /opt/ sub-directory.Contains add-on applications from individual vendors. /mnt – Mount Directory Temporary mount directory where

/mnt – Mount Directory

Temporary mount directory where sysadmins can mount filesystems./opt/ or /opt/ sub-directory. /mnt – Mount Directory /media – Removable Media Devices Temporary mount directory

/media – Removable Media Devices

Temporary mount directory for removable devices.can mount filesystems. /media – Removable Media Devices For examples, /media/cdrom for CD-ROM; /media/floppy for

For examples, /media/cdrom for CD-ROM; /media/floppy for floppy drives; /media/cdrecorder for CD writerDevices Temporary mount directory for removable devices. /srv – Service Data srv stands for service. Contains

/srv – Service Data

srv stands for service./media/cdrecorder for CD writer /srv – Service Data Contains server specific services related data. For example,

Contains server specific services related data.for CD writer /srv – Service Data srv stands for service. For example, /srv/cvs contains CVS

For example, /srv/cvs contains CVS related data.for CD writer /srv – Service Data srv stands for service. Contains server specific services related