Skip to content

Instantly share code, notes, and snippets.

@axelav
Last active September 30, 2015 18:58
Show Gist options
  • Save axelav/1846652 to your computer and use it in GitHub Desktop.
Save axelav/1846652 to your computer and use it in GitHub Desktop.
Quick summary of Linux directory hierarchy

Linux directory heirarchy


/bin binaries, basic Linux commands are here

/boot boot code, leave it be

/dev all devices/hardware, all treated as a stream

/etc config files & resources, only root user can modify

/home user account info & personal files

/lib shared library files essential for binaries

/lost+found stray files that can be recovered after a crash

/media mount points for removable media

/mnt mount points

/opt optional & larger application packages

/proc virtual files for various system processes

/root root user's home directory

/sbin essential system binaries reserved for the root user

/selinux security-enhanced Linux

/srv site-specific data

/sys virtual filesystem, similar to /proc

/tmp temporary files

/usr user applications, subdirectories for user-installed commands, kernel source, documentation, config files, man pages, etc.

/usr/share config files and graphics for numerous user applications

/usr/src source code for some system stuff, including the Linux kernel

/usr/include headers for c/c++ and some other development essentials

/usr/lib library files for the whole system. you may find lib, lib32 and lib64 for different architectures

/usr/local programs installed by the user manually

/usr/bin non-system essential programs and commands

/var variable files such as logs, cache, email

@larzconwell
Copy link

You might also want to split /usr up into a couple different ones because the dir is so big and complex.

/usr/share
Contains config files and graphics for numerous user applications

/usr/src
Contains source code for some system stuff. Including the Linux kernel.

/usr/include
Contains headers for c/c++ and some other development essentials

/usr/lib*
Contains library files for the whole system basically you may find lib, lib32 and lib64. each for different architectures.

/usr/local
Usually contains programs installed by the user manually.

/usr/bin
Contains non system essential programs and commands.

Oh also I like your list, It's really well formatted!

@axelav
Copy link
Author

axelav commented Mar 14, 2012

cool, I added in your /usr/ info. very helpful!

@larzconwell
Copy link

Awesome!

@axelav
Copy link
Author

axelav commented Aug 28, 2013

man hier in the cli gives you a lot of this info as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment