Chris Hoffman Explains Linux File System Conventions | How-To Geek

Embed Size (px)

Citation preview

  • 8/9/2019 Chris Hoffman Explains Linux File System Conventions | How-To Geek

    1/3

    HTG Explains: The Linux Directory Structure Explained

    http://www.howtogeek.com/!"#$/htg%explains%the%linux%directory%structure%explained/

    &' you(re coming 'rom )indows* the Linux 'ile system structure can seemparticularly alien. The +:, dri-e and dri-e letters are gone* replaced y a /and cryptic%sounding directories* most o' which ha-e three letter names.

    The ilesystem Hierarchy Standard 0HS1 de'ines the structure o' 'ile systems onLinux and other 23&4%like operating systems. Howe-er* Linux 'ile systems alsocontain some directories that aren(t yet de'ined y the standard.

    / 5 The 6oot Directory

    E-erything on your Linux system is located under the / directory* known as theroot directory. 7ou can think o' the / directory as eing similar to the +:,directory on )indows 5 ut this isn(t strictly true* as Linux doesn(t ha-e dri-eletters. )hile another partition would e located at D:, on )indows* this otherpartition would appear in another 'older under / on Linux.

    /in 5 Essential 2ser 8inaries

    The /in directory contains the essential user inaries 0programs1 that must epresent when the system is mounted in single%user mode. 9pplications such asire'ox are stored in /usr/in* while important system programs and utilitiessuch as the ash shell are located in /in. The /usr directory may e stored onanother partition 5 placing these 'iles in the /in directory ensures the systemwill ha-e these important utilities e-en i' no other 'ile systems are mounted.The /sin directory is similar 5 it contains essential system administrationinaries.

    /oot 5 Static 8oot iles

    The /oot directory contains the 'iles needed to oot the system 5 'or example*the G628 oot loader(s 'iles and your Linux kernels are stored here. The ootloader(s con'iguration 'iles aren(t located here* though 5 they(re in /etc withthe other con'iguration 'iles.

    /cdrom 5 Historical ount ;oint 'or +D%6

  • 8/9/2019 Chris Hoffman Explains Linux File System Conventions | How-To Geek

    2/3

    con'iguration 'iles 5 user%speci'ic con'iguration 'iles are located in eachuser(s home directory.

    /home 5 Home olders

    The /home directory contains a home 'older 'or each user. or example* i' youruser name is o* you ha-e a home 'older located at /home/o. This home 'oldercontains the user(s data 'iles and user%speci'ic con'iguration 'iles. Each useronly has write access to their own home 'older and must otain ele-atedpermissions 0ecome the root user1 to modi'y other 'iles on the system.

    /li 5 Essential Shared Liraries

    The /li directory contains liraries needed y the essential inaries in the/in and /sin 'older. Liraries needed y the inaries in the /usr/in 'olderare located in /usr/li.

    /lost='ound 5 6eco-ered iles

    Each Linux 'ile system has a lost='ound directory. &' the 'ile system crashes* a'ile system check will e per'ormed at next oot. 9ny corrupted 'iles 'ound will

    e placed in the lost='ound directory* so you can attempt to reco-er as muchdata as possile.

    /media 5 6emo-ale edia

    The /media directory contains sudirectories where remo-ale media de-icesinserted into the computer are mounted. or example* when you insert a +D intoyour Linux system* a directory will automatically e created inside the /mediadirectory. 7ou can access the contents o' the +D inside this directory.

    /mnt 5 Temporary ount ;oints

    Historically speaking* the /mnt directory is where system administrators mounted

    temporary 'ile systems while using them. or example* i' you(re mounting a)indows partition to per'orm some 'ile reco-ery operations* you might mount itat /mnt/windows. Howe-er* you can mount other 'ile systems anywhere on thesystem.

    /opt 5 ernel ? ;rocess iles

    The /proc directory similar to the /de- directory ecause it doesn(t containstandard 'iles. &t contains special 'iles that represent system and processin'ormation.

    /root 5 6oot Home Directory

    The /root directory is the home directory o' the root user. &nstead o' einglocated at /home/root* it(s located at /root. This is distinct 'rom /* which isthe system root directory.

    /run 5 9pplication State iles

    The /run directory is 'airly new* and gi-es applications a standard place tostore transient 'iles they re@uire like sockets and process &Ds. These 'ilescan(t e stored in /tmp ecause 'iles in /tmp may e deleted.

  • 8/9/2019 Chris Hoffman Explains Linux File System Conventions | How-To Geek

    3/3

    /sin 5 System 9dministration 8inaries

    The /sin directory is similar to the /in directory. &t contains essentialinaries that are generally intended to e run y the root user 'or systemadministration.

    /selinux 5 SELinux Airtual ile System

    &' your Linux distriution uses SELinux 'or security 0edora and 6ed Hat* 'orexample1* the /selinux directory contains special 'iles used y SELinux. &t(ssimilar to /proc. 2untu doesn(t use SELinux* so the presence o' this 'older on2untu appears to e a ug.

    /sr- 5 Ser-ice Data

    The /sr- directory contains Bdata 'or ser-ices pro-ided y the system.C &' youwere using the 9pache HTT; ser-er to ser-e a wesite* you(d likely store yourwesite(s 'iles in a directory inside the /sr- directory.

    /tmp 5 Temporary iles

    9pplications store temporary 'iles in the /tmp directory. These 'iles aregenerally deleted whene-er your system is restarted and may e deleted at anytime y utilities such as tmpwatch.

    /usr 5 2ser 8inaries ? 6ead%