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)

4
votes
6answers
16k 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 ...
2
votes
2answers
152 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 ...
11
votes
3answers
7k views

find with -execdir

When I run find with -execdir I don't get the results I was expecting. For example: mkdir -p a/b/c find . -type d -execdir touch foo \; $ tree a a ├── b │   ├── c │   └── foo └── foo Directory c ...
1
vote
2answers
29 views

Mount point for system-wide USB disk

I have a USB disk connected to a server computer which is mounted when the computer starts. I'm thinking that it's not ideal to mount it under the /media directory since it could potentially lead to a ...
8
votes
1answer
237 views

Where is program installed after ./configure

I'm installing a software using the following wget <URL package.tar.gz> tar xzvf package.tar.gr ./configure package cd package make make install My problem is that the package is not ...
42
votes
8answers
53k 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
9k views

What is the best place to put php files above server root directory?

I am running a web application and I want to move a directory containing my php files above the server root directory. Where would be the best place to put them? On my web server I rent from ...
2
votes
3answers
76 views

Where should I place my websites files with multiple vhosts?

If vhosts are enabled, where should I place my website files? /home/aunser/www /var/www/site1, /var/www/site2 /usr/local/website/site1, /usr/local/website/site2 the systems is CentOS 6.x/RHEL 6.x,...
2
votes
1answer
507 views

How to move the /var/www directory to a USB HDD?

I have a default OpenBSD 5.1 install. How Can I enabled httpd, OK. QUESTION: How can I use the /dev/sd0a on /mnt/usbhdd type ffs (local, nodev) instead of the default "/var/www" directory? What ...
0
votes
0answers
36 views

Where should the node_modules folder go? (Mint)

I'm just about to install Karma, Jasmine and NodeJS to start testing for AngularJS. I'm having a tough time figuring out where to put the node_modules folder. My question is split into two parts, does ...
4
votes
2answers
785 views

What's the difference between `/usr/share/emacs/site-lisp/` directory and `/usr/share/emacs23/site-lisp/` directory?

I use Emacs 23 on my system. I received a file from a colleague (who has a different Linux distro) to add to the /usr/share/emacs/site-lisp/ directory. As I worked to do this, I noticed another, ...
5
votes
2answers
4k views

Download files and create same file structure as the source

I have a config file which consists of list of URIs I want to download. For example, http://xyz.abc.com/Dir1/Dir3/sds.exe http://xyz.abc.com/Dir2/Dir4/jhjs.exe http://xyz.abc.com/Dir1/itr.exe ...
17
votes
4answers
6k 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/...
3
votes
2answers
62 views

Multiple tmpfs partitions

[mayur@mayur311-pc ~]$ df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/centos-root 50G 3.6G 47G 8% / devtmpfs 3.9G 0 3.9G 0% /dev tmpfs ...
11
votes
4answers
11k views

What are the world writable directories by default?

In a standard Linux filesystem, which of these common directories are world-writable by default? /tmp /etc /var /proc /bin /boot /.... .... Why are they world-writable? Does that pose ...
0
votes
3answers
179 views

Where can I find the shell script for ls command? [closed]

I am trying to understand how the ls command works, and I presume there is a shell script which defines ls somewhere in the filesystem. This correct? If so, where can I find it?
-1
votes
1answer
37 views

Extended permissions - after set acl, group cannot write [closed]

I want to use setfacl to set permissions to dir for the users group. I do something like this: mkdir /Employee chgrp employeers /Employee setfacl -m d:g::rwx /Employee And now, when I try to create ...
5
votes
2answers
2k views

Is it OK to store /var/tmp on a SSD? [duplicate]

I have read that you should not store /tmp on a SSD, because the frequent writes will shorten the lifetime of the SSD. But what about /var/tmp? Is it reasonable for /var/tmp to be stored on a SSD? ...
2
votes
2answers
1k views

Is there a --parents option for mv like for cp?

cp has a useful feature --parents that allows a file's directory structure to be copied to another directory: $ cp -v --parents source/directory/from target/ ‘source/directory/from’ -> ‘target/...
0
votes
2answers
33 views

Man directory layout — why the subdirectories?

Man expects the man directories listed in $MANPATH or $(manpath) to be split by section into directories named "man$section". This duplicates the section information that is already available in the ...
3
votes
1answer
39 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
25 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 ...
59
votes
4answers
21k 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
41 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 files,...
0
votes
1answer
48 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
63 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/...
6
votes
2answers
6k 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
231 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
26 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
51 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
116 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 ...
1
vote
1answer
20 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 ...
11
votes
5answers
22k 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
34 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
66 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
36 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 perspective....
1
vote
1answer
89 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
69 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 ...
2
votes
4answers
66 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 ...
60
votes
9answers
60k 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
91 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
625 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
88 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/...
-2
votes
2answers
64 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
110 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) ...
20
votes
2answers
9k 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
59 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
39 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
48 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, ...