Questions tagged [directory-structure]

The layout of the directory hierarchy — questions like “where does this file belong?” or “what is this directory for?”.

Use this tag for questions about the directory structure of unix filesystems.

Linux systems by and large follow the filesystem hierarchy standards. Other unix variants may have slightly different habits.

453 questions
752
votes
3 answers

What is the purpose of the lost+found folder in Linux and Unix?

There is a folder at the root of Linux and Unix operating systems called /lost+found/ What is it for? Under what circumstances would I interact with it? How would I interact with it?
Wesley
  • 13,563
  • 12
  • 34
  • 49
588
votes
9 answers

What is the difference between /opt and /usr/local?

According to the Filesystem Hierarchy Standard, /opt is for "the installation of add-on application software packages". /usr/local is "for use by the system administrator when installing software locally". These use cases seem pretty similar. …
Patches
  • 6,222
  • 3
  • 14
  • 11
236
votes
9 answers

What does etc stand for?

What does the "etc" folder in the root directory stand for? I think knowing this will help me remember where certain files are located. Update: Might be useful for others, the folder is used for "Host specific configuration files" - reference.
David Tang
  • 2,471
  • 2
  • 14
  • 7
228
votes
13 answers

Find the total size of certain files within a directory branch

Assume there's an image storage directory, say, ./photos/john_doe, within which there are multiple subdirectories, where many certain files reside (say, *.jpg). How can I calculate a summary size of those files below the john_doe branch? I tried du…
mbaitoff
  • 4,571
  • 8
  • 27
  • 32
179
votes
4 answers

What is the difference between /tmp and /var/tmp?

On most FHS systems, there is a /tmp folder as well as a /var/tmp folder. What is the functional difference between the two?
Wesley
  • 13,563
  • 12
  • 34
  • 49
174
votes
5 answers

Where do I put my systemd unit file?

I read that there are two folders for unit files (not in user mode). /usr/lib/systemd/system/: units provided by installed packages /etc/systemd/system/: units installed by the system administrator Conflicting with this understanding is the answer…
Jonathan Komar
  • 4,942
  • 6
  • 27
  • 50
146
votes
16 answers

Where should I put software I compile myself?

I need to compile some software on my Fedora machine. Where's the best place to put it so not to interfere with the packaged software?
141
votes
2 answers

What is this folder /run/user/1000?

What is this folder: /run/user/1000 on my Fedora system and what does it do? ~ $ df -h Filesystem Size Used Avail Use% Mounted on tmpfs 1.2G 20K 1.2G 1% /run/user/1000 EDIT: 7 june 2019. My two answers don't agree on what…
somethingSomething
  • 5,248
  • 18
  • 55
  • 93
136
votes
9 answers

What's the most appropriate directory where to place files shared between users?

Or: where can I put files belonging to a group? Suppose there are two users on a Unix system: joe and sarah. They are both members of the movies-enthusiast group. Where should I put their movie files? /home/{joe,sarah}/movies are not appropriate…
user16538
  • 1,643
  • 3
  • 12
  • 9
136
votes
4 answers

Where should a local executable be placed?

I have an executable for the perforce version control client (p4). I can't place it in /opt/local because I don't have root privileges. Is there a standard location where it needs to be placed under $HOME? Does the File System Hierarchy have a…
132
votes
7 answers

What is /usr/local/bin?

Before today, I've used the terminal to a limited extent of moving in and out of directories and changing the dates of files using the touch command. I had realised the full extent of the terminal after installing a fun script on Mac and having to…
JFW
  • 2,077
  • 2
  • 15
  • 11
112
votes
9 answers

Why is the root directory on a web server put by default in "/var/www"?

Tuxfiles says the following about the Linux directory structure: /var: This directory contains variable data that changes constantly when the system is running. FHS on /var says the following: /var contains variable data files. This includes…
jonallard
  • 1,556
  • 4
  • 13
  • 13
101
votes
2 answers

What is this new /run filesystem?

I just ran df -h a minute ago and noticed a filesystem has been added that I'm not familiar with. Does anyone know why /run exists? Is this something that's been added by the kernel? By Arch Linux? run 10M 236K 9.8M 3% /run
xenoterracide
  • 55,442
  • 70
  • 180
  • 243
96
votes
3 answers

Why is the root directory denoted by a / sign?

I have done some research about this on Google, but the results were cloudy. Why is the / sign used to denote the root directory. Are there any solid reasons behind it?
Ruban Savvy
  • 8,061
  • 7
  • 28
  • 43
92
votes
12 answers

Why is Linux's filesystem designed as a single directory tree?

Can anyone explain why Linux is designed as a single directory tree? Whereas in Windows we can have multiple drives like C:\, and D:\, there is a single root in Unix. Any specific reason there?
user2720323
  • 3,359
  • 7
  • 24
  • 25
1
2 3
30 31