Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [fhs]

Filesystem Hierarchy Standard

383
votes
6answers
229k views

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 ...
127
votes
4answers
77k views

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?
125
votes
17answers
37k views

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?
114
votes
7answers
45k views

What does the .d stand for in directory names?

I know many directories with .d in their name: init.d yum.repos.d conf.d Does it mean directory? If yes, from what does this disambiguate? UPDATE: I've had many interesting answers about what the ....
81
votes
5answers
67k views

Difference between /bin and /usr/bin

I read this up on this website and it doesn't make sense. http://rcsg-gsir.imsb-dsgi.nrc-cnrc.gc.ca/documents/basic/node32.html When UNIX was first written, /bin and /usr/bin physically resided ...
77
votes
9answers
24k views

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?...
55
votes
2answers
33k views

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 $...
45
votes
4answers
10k views

Is the slash (/) part of the name of the Linux root directory?

Is the slash (/) really part of the name of the Linux root directory? Or is it just a symbol for it? What about /etc and so on? Update Suppose /dev/sda2 is the block device of a Linux root ...
40
votes
9answers
20k views

What is the /boot partition really for?

I'm reading a relatively old text on Linux partitions and file systems (the LPIC 1 Certification Bible). It says: Some versions of the Linux boot loaders cannot access a kernel that is outside ...
37
votes
4answers
4k views

What's the difference between /tmp and /run?

According to FHS-3.0, /tmp is for temporary files and /run is for run-time variable data. Data in /run must be deleted at next boot, which is not required for /tmp, but still programs must not assume ...
34
votes
6answers
32k views

where is `cd` located? [duplicate]

In a bash sub shell I get the following error when running cd sudo: cd: command not found This is expected because I don't have a path. Usually to work around this I just provide the full path like ...
31
votes
5answers
2k views

What are the alternatives to the FHS?

I'm a long time Linux user for over 15 years but one thing I hate with a passion is the mandated directory structure. I don't like that /usr/bin is the dumping ground for binaries or libs in /usr/lib, ...
29
votes
2answers
36k views

What is the “/usr/local/src” folder meant for?

I wanted to put my work files (code) in /usr/local/src, but I think it's already a folder that has some other semantic meaning. What is that? Should I put source code there, or is there a better ...
28
votes
1answer
1k views

At what point did the /home directory appear?

Originally in Unix, /usr was used for user (home) directories. So if I had a user named alex, my home directory would be /usr/alex. (Interestingly, Plan 9, the successor to Unix, still has user ...
24
votes
3answers
11k views

Standard and/or common directories on Unix/Linux OSes

Coming from the Windows world, I have found the majority of the folder directory names to be quite intuitive: \Program Files contains files used by programs (surprise!) \Program Files (x86) contains ...
24
votes
2answers
5k views

Is there a reason I would not add /usr/local/sbin, /usr/sbin, /sbin to my path on Debian?

Compare Debian (left) and Ubuntu (right): $ ifconfig $ ifconfig bash: ifconfig: command not found eth0 Link encap ... $ which ifconfig ...
23
votes
4answers
14k views

What is the difference between /etc and /usr/local/etc

I am developing a daemon that needs to store lots of application data, and I noticed that on my system (Fedora 15), there is a /usr/local/etc directory. I've decided to install my daemon to /usr/...
22
votes
3answers
15k views

Permissions/ownership of /usr/local/bin

From what I understand, the right place to put your own scripts is /usr/local/bin (for instance a script I use to back up some files). I notice that this folder is currently (by default) owned by root,...
22
votes
4answers
11k views

What is the purpose of /usr/libexec?

Executables are stored in /usr/libexec on Unix-like systems. The FHS says (section 4.7. /usr/libexec : Binaries run by other programs (optional)": /usr/libexec includes internal binaries that are ...
20
votes
1answer
791 views

How did the ~/.local/bin thing start? How widespread is it?

I find more and more tools that put executables into ~/.local/bin. I am old and for me ~/bin is the place in my $HOME for executables. Where did this crazy new fashion originate? Why are people doing ...
18
votes
1answer
8k views

what is the distinction between /media, /mnt and /run/mount?

In FHS-2.3, we have /media that holds mount points for removable media such as CD-ROMs and we have /mnt that holds temporarily mounted filesystems. On the other hand, we have /run/media and /run/...
17
votes
3answers
5k views

Is it bad/dangerous/inappropriate to put arbitrary backups in /var/backups?

There's a system-created /var/backups directory on Debian-based systems. I need a place to store backups of several git repositories (the primaries are on bitbucket). If I store them in /var/backup/...
13
votes
2answers
2k views

Where should an /opt package write logs?

I am installing a custom package to /opt/package_name, storing configuration files in /etc/opt/package_name and static files in /var/opt/package_name/static/ - all following the conventions suggested ...
10
votes
4answers
2k views

What are the FHS compliant mount points?

I'm wondering what the FHS compliant mount points for internal harddrives and networkshares are? Many different tutorials are suggesting to mount them in subdirectories to /mnt or /media According ...
10
votes
1answer
2k views

What is the meaning/purpose of *.pid files in /var/run

I'm quite new in Linux world, and now I'm trying to understand FHS principles. In /var/run I found about ten *.pid files like crond.pid which contain just PIDs. There are more than ten processes ...
9
votes
1answer
6k views

How should executables installed under /opt be added to the path?

Can programs installed under /opt be safely symlinked into /usr/local/bin, which is already in the PATH by default in Ubuntu and other Linux distros? Alternatively, is there some reason to create a ...
8
votes
2answers
2k views

Why there are no READMEs in the Linux filesystem hierarchy?

The Linux filesystem hierarchy (FHS) contains a lot of important directories. For example, I just discovered /sys/class/input while playing with my PS/2 keyboard settings. But all those important ...
8
votes
4answers
8k views

Why did my package get installed to /opt?

A while back I installed couchdb from source on my debian machine. It seemed to install okay and everything worked. A few weeks later I wanted to upgrade and installed from a .deb using dpkg. ...
8
votes
1answer
9k views

What's the difference between a binary file and a library?

I'm trying to understand the Filesystem Hierarchy Standard. I have looked up both binaries and libraries, and as I currently understand it: binaries are files of computer-readable code in binary ...
7
votes
3answers
2k views

Why would I keep home directories in /var/home?

As far as I understand, the traditional place for home directories is beneath /home. Some Linux variants seem to keep them in /var/home, what's the reason for that?
7
votes
1answer
2k views

Why is /bin a symbolic link to /usr/bin?

According to the Filesystem Hierarchy Standard the /bin directory should contain utilities needed in single user mode. In practice, many Linux distributions make the directory a symbolic link to /usr/...
6
votes
2answers
2k views

FHS differences between OS X, Linux and FreeBSD

I've read that there is a different behavior between FreeBSD and Linux with the /usr/local, in FBSD ports are installed there, in Linux not, can someone explain more on this? I'd like to know where ...
5
votes
2answers
174 views

Are there any discussions about proposing a new filesystem hierarchy standard?

Are there any current discussions about switch to a different standard directory hierarchy for Linux? The only thing I currently know of is GoboLinux, which looks quite outdated.
5
votes
2answers
5k views

Per user tmpfs directories

Using the shared /tmp directory is known to have lead to many security vulnerabilities when predictable filenames have been used. And randomly generated names aren't really nice looking. I am ...
4
votes
2answers
538 views

Installing from source - do I need to keep the extracted tarball directory

If I'm installing from source, do I need to keep the extracted tarball directory? So if I download the git tarball. I then do: tar -xvzf git.tar.gz This will create a git.x.x. directory, into which ...
4
votes
1answer
239 views

Why does System V traditionally symlink /bin to /usr/bin?

This systemd wiki page about the /usr merge, under Myth #6, states that /bin has traditionally been a symlink to /usr/bin on System V UNIX. What is the motivation for this? For backwards ...
4
votes
2answers
2k views

Linux file hierarchy - what's the best location to store lockfiles?

I want to synchronize processes based on lock files (/ socket files). These files should only be removable by their creator user. There are plenty of choices: /dev/shm /var/lock /run/lock /run/...
4
votes
2answers
3k views

Logic behind Postgres binary installation path on Debian

It appears that the Postgresql installation is split into three folder locations on Debian: Configuration: /etc/postgresql Binaries: /usr/lib/postgresql Data: /var/lib/postgresql I ...
4
votes
1answer
199 views

Where to store shared data in FHS 3.0?

I'm working on a FHS2-conforming application that used to store data in $sharedstatedir (i.e. $(prefix)/com, e.g. /usr/local/com). This directory is no more in FHS 3.0, and it seems that we need to ...
4
votes
1answer
140 views

Where should I install seafile-server: /opt or /home?

Reading Filesystem Hierarchy Standard I was considering those directories: /opt: Optional application software packages. /home: Users' home directories, containing saved files, personal settings, etc....
3
votes
4answers
746 views

Is the Filesystem Hierarchy Standard a UNIX standard or a GNU/Linux standard?

The Filesystem Hierarchy Standard says where to put stuff in a UNIX distribution. Is the FHS used/designed for use outside of GNU/Linux, or is it mostly limited to GNU/Linux?
3
votes
2answers
565 views

What is meant by “locally installed package” in the world of Unix?

I've been scratching my head over the File System Hierarchy Standard recently and in numerous occasion, when talking about the /usr/local directory, I came across the term "locally installed packages"....
3
votes
2answers
631 views

How to split FHS read-only and read/write directories across two disks with Linux/systemd, without partitioning the raed/write disk?

My objective is to have the physical storage for the Linux FHS read/write directories (/home, /srv, /tmp, /var) on a separate (logical or physical) disk from the potentially read-only rest of the root ...
3
votes
2answers
930 views

How to add new elements to PATH for daemons (or other best practices)?

I want to add some scripts for custom administrative work to a Linux server (Ubuntu 12.04). Ultimately those scripts are callback scripts from at least one daemon (PostgreSQL in my case but that ...
3
votes
2answers
129 views

Which directories are writeable in a system following FHS?

I need to ensure that, when deleting a specific user from a system, all of his/her files are removed. User creation/deletion will happen a lot on this system, so I want to reuse UID's and want to ...
3
votes
2answers
1k views

Why is “dir-or-file-in-usr-local” an error rather than a warning?

I'm building some rpm packages and checking for standards and style conformance using rpmlint. The packages are specific to systems at my place of work and they won't get pushed upstream. Our ...
3
votes
1answer
154 views

Where to securely place files needed by PHP in Linux filesystem (according to FHS)

I have a PHP script running on my LAMP server that requires certain files in order to produce HTML content. The script is publicly accessible (i.e. http://example.com/script.php) but the files ...
3
votes
0answers
173 views

Is the directory /apps/ a legacy of anything?

Several times, I have seen in (quite) big projects, software installations made under /apps/ First I thought it was a fantasy, refusing FHS normalisation. https://en.wikipedia.org/wiki/...
3
votes
0answers
116 views

Are {/bin, /lib, /sbin} symlinks into /usr in Ubuntu?

I am a little confused by this question about moving files from /bin to /usr/bin on an Ubuntu 17.04 system. Reading the Ubuntu wiki says: For Quantal, merged /usr should be supported. On new ...
2
votes
3answers
797 views

Why isn't the var directory user-specific?

I'm quite new in the UNIX world, so feel free to let me know if my question is silly. So-called Filesystem Hierarchy Standard states that the /var directory is supposed to keep data like logs and ...