Guide to Linux Directory Structure


Recommended Posts

The below guide has been taken from IeXbeta and was compiled by member vboyz103

I thought some of you may find it useful. It does make for a good read.

====================================================

Linux sees things as files and folders, for instance, your floppy drive is seen under Linux as /mnt/floppy, or CD-ROM drive as /mnt/cdrom and etc.

So this is the the overall Linux system architecture.

/

This directory is the ROOT of Linux where everything goes under here.

/usr/bin

This is where all the clients executables like GNOME desktop or KDE.

/usr/sbin

System-wise executables such as hdparm etc.

/usr/local

This is a default location for all 3rd party software installation.

/usr/src/linux-x.x (where x.x is the kernel version)

This is where you go if you want to compile Linux Kernel.

/etc

This directory contains all the CONFIGURATION files for daemons, software etc.

/var

This is a place to store logs for softwares, system logs, and cache for daemon such as squid.

/root

This is a home for user root.

/opt

Often is used for install third party software which Oracle, StarOffice, OpenOffice etc.

/tmp

This is like a C:\Windows\Temp directory in windows.

/boot

Contains all the boot images for Linux.

/home

This is where all the users account info are stored, disk quota can be set here.

/lib or /usr/lib

Are system/software library directories.

/proc

This is VITAL directory for Linux, because it contains all the info. to your hardware from CPU info, to VIDEO Card, BIOS, Hard disks, RAM, etc.

/sbin

This is usually where all the executables for daemon/servers such as DHCP, etc.

=======================================================

If you guys can supply any useful additions please feel free to add here.

Link to comment
https://www.neowin.net/forum/topic/64329-guide-to-linux-directory-structure/
Share on other sites

I think you're a bit confused, Keldyn:

/boot - contains information for the LILO or Grub interface and MBR information.

/etc - contains the configuration files for various programs.

/usr/src - contains the kernel source and configurations

/usr/bin - contains the links to execute the software.

/usr/lib, /usr/local or /usr/share - contains the libraries needed to run the software.

/root - the home directory for the root user.

/home/(user name) - the home directory for all the other users.

/var - contains the logs generated through the various actions done in Linux

/dev - contains the information for all of your devices

/mnt - links to any external partitions, CD-ROM's, DVD-ROM's, Zip drives, and Floppy drives.

  Webgraph said:
I think you're a bit confused, Keldyn:

He doesn't write this. I think, you are confusing too.

http://www.pathname.com/fhs/

http://www.gsp.com/cgi-bin/man.cgi?section...on=7&topic=hier

Well, honestly it's people's personal prefer. I personal rather to follow strict FreeBSD's hier(7) and FHS is near same.

  Quote
/usr/lib, /usr/local or /usr/share - contains the libraries needed to run the software.

/usr/local isn't libraries, which it's "another" /usr to keep the system to be seprate from other stuff what SysAdmin install. To avoid the conflict, confuse and make more easier life.

Came with system base:

/usr/bin/

/usr/lib/

goes on..

SysAdmin install non-X:

/usr/local/bin/ <-- this is execute stuff

/usr/local/lib/ <-- this is libraries..

goes on..

SysAdmin install X:

/usr/X11R6/bin/ <-- this is execute stuff

/usr/X11R6/lib/ <-- this is libraries..

goes on..

Some people prefer: (I hate this..)

/opt/bin/ <-- this is execute stuff

/opt/lib/ <-- this is libraries..

goes on..

Note: As you can see, it's easier to keep system seprate from what SysAdmin has installed. Also, I like to keep stuff under /usr, because it's easier to setup the size of slice partition rather than create many slice like /opt or whatever.

Anyway, the two links above provide the better explains and etc.

  Webgraph said:
I think you're a bit confused, Keldyn:

I think you should read it again...

I clearly stated i did not write it. There is nothing wrong with the guide, it is more a matter of personal preference as mezz has pointed out already. There are many ways to do this. What i have provided is just one example. It is over simplified i understand, but that is what makes it so perfect for people who are new to linux.

I don't know if this fits here. well, I guess it does. But I wanted to also suggest for new linux users, after fresh install is choose your main home working directory and set up some kind of folder structure there also. What I mean is somewhere to keep all your downloaded files, themes, documents, etc, etc. Because your /home directory can end up very cluttered if not, especially if you have your filebrowser set to show hidden files and folders. I usually just set up Documents as my main folder(like C:\ in windows) and then sub-folders beneath such as "wallpaper" "themes""saved_documents" etc. you get my drift anyway.

Just a suggestion because alot of programs create folders just under home and along with your folders it can get cluttered quick.

  wickedlester said:
What I mean is somewhere to keep all your downloaded files, themes, documents, etc, etc. Because your /home directory can end up very cluttered if not, especially if you have your filebrowser set to show hidden files and folders.

True.. What do I do with the home directory? I usually do /home -> /usr/home..

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Actually, when Windows came to "play" decades ago, they never left. Play took over the Operating System to the detriment of business of serious consumer users. Made worse, in the Microsoft removed the option to have a "non-play oriented version of the OS" (as in a separate SKU).
    • ".....hellbent on shoving Copilot down the throats ..." Not great journalism IMHO. Put it in an opinion piece. Besides it's cliché.
    • Well that should last us until Sunday, December 4, 292277026596 at 15:30:08.
    • Windows 11 build 27909 is out with fixes for battery indicator and more by Taras Buria This week's Friday Windows 11 preview build comes from the Canary Channel with a few fixes here and there. No new features or noticeable changes in build 27909, so Windows 11 Insiders get to test several fixes and general improvements. Here is the changelog: [General] This update includes a small set of general improvements and fixes that improve the overall experience for Insiders running this build on their PCs. [Administrator Protection] Fixed an underlying issue where the Xbox app wouldn’t launch when administrator protection was enabled. This may have also impacted other apps too, showing error 0xC0000142 or 0xC0000045. [Settings] Fixed an issue where the battery percentage was unexpectedly missing from the top of System > Power & Battery in the last few builds. [Remote desktop] Fixed an issue causing extreme graphical distortion and rendering issues using remote desktop on Arm64 PCs in the last couple builds. [Other] Fixed a high hitting pcasvc.dll crash in the previous build. Fixed an underlying issue where if you disconnected the device you were casting to from outside of Media Player, Media Player would still show an option to disconnect from the device. Fixed an issue which was causing Remote Credential Guard scenarios between the latest Windows 11 builds and Server 2022 (and below) to fail. The list of known issues includes the following: [General] [IMPORTANT NOTE FOR COPILOT+ PCs] If you are joining the Canary Channel on a new Copilot+ PC from the Dev Channel, Release Preview Channel or retail, you will lose Windows Hello pin and biometrics to sign into your PC with error 0xd0000225 and error message “Something went wrong, and your PIN isn’t available”. You should be able to re-create your PIN by clicking “Set up my PIN”. There’s an issue starting with the latest builds causing a small number of Insiders to experience repeated bugchecks with KERNEL_SECURITY_CHECK_FAILURE after upgrading.This may occur when connecting to VPN. This Canary Channel flight comes with a delightful blast from the past and will play the Windows Vista boot sound instead of the Windows 11 boot sound. The fix should be coming in a future Canary Channel flight soon. [Settings] We’re investigating an issue in this build which could cause Settings to crash when interacting with the options under Settings > System > Power & Battery. We’re investigating an issue where some of the apostrophes across text in Settings and settings-related dialogs are not displaying correctly and are showing random characters. You can find the announcement post here.
    • And they didn't use Clippy for that? What a waste
  • Recent Achievements

    • Week One Done
      CyberCeps666 earned a badge
      Week One Done
    • Very Popular
      d4l3d earned a badge
      Very Popular
    • Dedicated
      Stephen Leibowitz earned a badge
      Dedicated
    • Dedicated
      Snake Doc earned a badge
      Dedicated
    • One Month Later
      Philsl earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      629
    2. 2
      ATLien_0
      240
    3. 3
      Xenon
      163
    4. 4
      neufuse
      124
    5. 5
      +FloatingFatMan
      124
  • Tell a friend

    Love Neowin? Tell a friend!