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

learn more… | top users | synonyms (1)

3
votes
1answer
31 views

How to call a binary outside PATH

I recently downloaded Master PDF Editor. It's a proprietary software for Linux and the archive contained bascically only a *.desktop file and the actual binary. Looking at the *.desktop file, the ...
3
votes
1answer
16 views

Where can users' personal data be?

I want to secure my data on a multi-user system, so ful-system encryption is not an option. I encrypted /home/me with ecryptfs, the swap with cryptsetup. But I read that the applications can ...
53
votes
4answers
18k 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?
1
vote
2answers
33 views

Are all files outside of /home/userabc owned by root?

I'm writing a tar implementation for a package manager, and I wonder if I can skip the permission setting of the user in the tar headers and keep what is there by default, the user who wrote the ...
0
votes
1answer
40 views

How to find the parent of a file by inode

I want to use ntfsundelete to maintain the directory structure of the recovered files. The output of ntfsundelete is like this: Inode Flags %age Date Size Filename 191321 FN.. ...
1
vote
2answers
43 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 ...
6
votes
2answers
5k views

What are the files located in `/var/crash/`?

I know when a program crashes, some files creating in /var/crash/. But I don't know what these files are! Is that error logs?
-2
votes
4answers
170 views

Is there a designated place for scripts that are (indirectly) automatically executed by systemd?

Arch Linux Question (or any OS that uses systemd to manage processes and follows the Filesystem Hierarchy Standard by the Linux Foundation) I recently asked where to but a systemd unit file: Where ...
0
votes
1answer
19 views

Where should I put a standalone web app which doesn't require an external web server?

I have a stand-alone web app, it's an executable file. At this point it doesn't require nginx or apache in front of it because it has a built-in webserver. Where should I put it on a server? In the ...
9
votes
2answers
2k views

Linux File Versioning?

We are migrating from A VMS environment to a Linux environment for some old alpha servers we are decommissioning. The one challenge I have not been able to overcome is file versioning. VMS keeps ...
0
votes
2answers
33 views

remove log files

I have a folder which in turn contain multiple sub-folders. All of these sub folders have a log folder. How to clear all the log files alone from all the log folders in these sub-directories using a ...
3
votes
1answer
88 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 ...
0
votes
1answer
14 views

What was xhbin?

I've googled, searched Unix & Linux Stack Exchange, and... well, there's not really much else I can do, is there? I was browsing some quines in various shell languages, and I came upon the ...
8
votes
5answers
18k views

Into which directory should I install programs in Linux?

I want to install a program in Linux and run it as a daemon. (Team Speak 3 in this case, but the question is general in nature). There is no package provided, only tarred binaries. Where in directory ...
3
votes
1answer
28 views

Where is the recommended place to install applications that are not from apt?

The SDK for Dart comes as a zip file for Linux. I've only previously installed software using apt-get. Is there a convention for where I should put the dart-sdk folder? And should I add dart-sdk\bin ...
5
votes
1answer
59 views

What's the relevance of these bash completion suggestions?

~ is $HOME. For me, cd ~ is /home/cat. Simple so far, yes? In Bash, the following happens: cat @ mint-kitty : ~/Downloads $ cd ~ # from /home/cat/Downloads to /home/cat/, as an example, but ...
1
vote
1answer
34 views

What's the correct location to install a bunch of scripts & support files for a program?

I have a project that comprises a bunch of different files (listed below). I'm creating an install script for it, and want to make sure they all go in the right place from a unix hierarchy ...
4
votes
6answers
12k views

How to recreate /var/lib/dpkg/status?

I have deleted some files around /var/lib/dpkg/, namely: /var/lib/dpkg/status /var/lib/dpkg/available /var/lib/dpkg/info/* I understand Debian uses these files to keep some information about ...
1
vote
1answer
45 views

How to copy files from one directory to another so that only new files are copied? [duplicate]

How would it be possible to copy all new contents from one directory to another so that only new files are copied from the source directory (both directories have the same naming tree). For example, ...
0
votes
0answers
29 views

how do I execute a command on multiple files located in different directories at once and directing the output to a new directory

I am trying to write a script that will execute a command on files in many directories while returning the output to another directory in an organised way. I did a dry run and got some good results ...
1
vote
1answer
44 views

How to redirect file output to a different directory?

I have a program that regularly outputs files to a directory, let's say /a/b. I am utterly unable to change where these files are outputted. But for me to use them, I must first move them to, let's ...
2
votes
4answers
62 views

How can I tell my program to save in ~

I'm using a program which processes some data and then saves it to a file. It is possible to specify the directory in which the data is saved, however the program is badly written, so if I put ~ it is ...
57
votes
9answers
54k views

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 ...
2
votes
2answers
59 views

Grep only in files that are in certain folders

I want to grep for interesting string, but only in specific folder/file combinations, such as myfolder/myfile.out. The directory I'm grepping from may have these combinations in subdirectories of ...
14
votes
7answers
595 views

Compact bash prompt when using a directory tree / filename

In a system with Ubuntu 14.04 and bash, I have the PS1 variable ending with the following contents: \u@\h:\w\$ so that the prompt appears as user@machinename:/home/mydirectory$ Sometimes, ...
1
vote
1answer
79 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 ...
-2
votes
2answers
56 views

How do I keep the /lib folder clean?

I have been installing libraries for use with c programs. Is there a way to keep the /lib folder clean? Can I use subdirectories, links, etc to manage this? It's getting pretty cluttered, I'm not ...
2
votes
2answers
53 views

Change the default program installation location?

I have learn linux recently, but i confused about how linux system works, especially about how linux handle program files, in windows all program is in one directory Programfiles (and some in Windows) ...
19
votes
2answers
8k 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 ...
2
votes
1answer
47 views

What is “var” an abbreviation of?

In the context of /var is that an abbreviation for "variables"? Or what's the intention behind the naming of this folder?
1
vote
2answers
38 views

Is it possible to specify a path in which a directory name is variable?

Asking this question on mpv player and dvds, I stumbled into a more generic question: is it generally possible to specify a path in which one of the directory names is variable? Let's say that I want ...
2
votes
1answer
36 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, ...
2
votes
1answer
51 views

Information leaks out of encrypted file system

If I only encrypt the home directory, what are some common ways for information to leak out to the unencrypted part of the file system? Aside from the obvious problems like swap space files in /tmp ...
0
votes
1answer
33 views

Clone directories [closed]

I have certain directory path like this /backup/data/cm/au and /backup/data/cm/ds. I have to create paths from /cm/au and cm/ds in tmp with same owner and group of their originals.
2
votes
3answers
57 views

Installing files in ~/.local

When installing software compiled from source, I normally place them in /usr/local/, which is by far the most common default in my experience, and standard practice at least on Debian and its ...
1
vote
0answers
27 views

How to mount to subdirectory of autofs

I have follong problem - I'd like to use autfs in one place to mount to subdirectory of autofs. I.e. I'd like to have something like: foo -fs=... bar/baz -fs=... The problem is that (according to ...
5
votes
2answers
57 views

Installing programs on a removable drive

I am planning to install some software on removable media (which will presumably always be present in the computer, though it's possible that there could be occasions where it is absent). After doing ...
78
votes
12answers
7k views

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?
0
votes
1answer
36 views

Where to place application files in embedded linux deployment?

I'm building a control device that runs Debian Jessie on a ARM based Linux SBC. I'm curious what the recommended location is for application files? To date, I've been placing things in a root level ...
0
votes
1answer
75 views

Strange directories in /home

There are some strange directories appearing in /home (so far, maybe in other locations too). These directories do not show up in ls but do with bash's tab autocomplete, when doing things like cd. ...
0
votes
2answers
286 views

What's the difference between mnt vs media? [duplicate]

What is the purpose of having both? Aren't they both used for mounting drives?
7
votes
1answer
1k 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 ...
1
vote
3answers
40 views

Standard environment variables for distribution-specific paths

It seems to me that there's a lot of confusion (or at least there is on my part) about how different file systems are structured among different distributions of Linux/Unix. It would stand to reason ...
36
votes
6answers
45k views

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 ...
2
votes
2answers
32 views

Where should an application be installed if it consists of multiple files?

I have noticed that essentially all the files in /usr/bin are stand-alone executables, rather than a directory containing the executable plus other files that the executable might need (such as ...
-1
votes
2answers
42 views

/etc/default/sw vs /etc/sw vs /etc/sw.d/ [closed]

I've seen many software in Linux that use these three locations to store their configuration. /etc/sw /etc/default/sw /etc/sw.d/ So my question is: Why there are three places and what is the ...
2
votes
2answers
53 views

Uninstalling or updating programs installed in /usr/local

When installing programs (e.g. openmpi, comsol, lammps) to /usr/local, usually a lot of separate files are created in /usr/local/bin, /usr/local/lib, /usr/local/src etc. Now when I want to uninstall ...
5
votes
1answer
118 views

Find all dirs/files that have symlinks pointing to them?

I am in a situation where I want to delete some cruft, but there might be some symlinks pointing to the cruft, so I don't want to delete those targets. Is there a command or some switches that will ...
122
votes
6answers
52k 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 ...
83
votes
3answers
14k views

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?