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)

251
votes
3answers
75k views

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?
73
votes
3answers
11k 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?
69
votes
12answers
6k 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?
64
votes
17answers
7k 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?
62
votes
5answers
16k 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 ...
53
votes
7answers
15k views

What is the Linux equivalent to C:\Program Files?

I understand that in Windows as well as Linux and Unix, a program|application|software can be installed in any directory. Also if packages are installed using the distribution's packaging system, ...
51
votes
3answers
2k views

Why does '/' have an '..' entry?

This just baffles me. Why does the root directory contain a reference to a parent directory? bob@bob:/$ ls -a . build home lib32 mnt .rpmdb sys vmlinuz .. cdrom ...
42
votes
4answers
3k views

How do I know where to put things in linux?

Installing something in windows takes a click of a button. But every time I try to install something in linux, which is not found in APT, I get so confused. You download a zipped folder, then what? ...
36
votes
7answers
19k views

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 ...
35
votes
8answers
1k 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 ...
35
votes
8answers
18k 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 ...
29
votes
3answers
6k 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?
29
votes
2answers
8k views

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? ...
28
votes
8answers
29k views

What is /usr/local/bin? Came across it in an script installation for Applescript but would like to know more

Before today, I've used Terminal to a limited extent of moving in and out of directories, changing the dates of files using the touch command, but had realised the full extent of Terminal after ...
27
votes
5answers
5k views

Why do /usr and /tmp directories for Linux miss vowels in their spellings?

I have often started to think about this but never found a good answer. Why are these two Unix directories not /user and /temp instead? All the other directories under root seem to be exactly what ...
27
votes
1answer
1k views

Why aren't crontabs stored in user home directories?

I'm curious to know: why are crontabs stored in /var rather than in the user's home directories? It makes it a total pain to isolate these files for upgrades but I suspect that there is a logical ...
19
votes
1answer
716 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 ...
17
votes
3answers
2k 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 ...
16
votes
4answers
474 views

Which folder should I write to for my intermediate files, as a dev?

I'm starting to write a few bash scripts for my project and they need some intermediate files or variables to be written. I want to know which folders can I be sure of having access to when someone ...
16
votes
0answers
490 views

How did the system settings directory on UNIX come to be named /etc? [duplicate]

Possible Duplicate: What does etc stand for? And why isn't it named /cnf or /syscf or /cfg? No one I have ever asked has been able to tell me, not that I have access to any of the minds ...
11
votes
2answers
3k 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 ...
10
votes
5answers
3k views

What's so special about directories whose names begin with a dot?

I was wondering what the difference between these two were: ~/somedirectory/file.txt and ~/.somedirectory/file.txt It's really difficult to ask this on Google since I didn't know how to explain ...
10
votes
2answers
343 views

Why do so many programs live in PATH?

One thing that puzzles me about desktop Linux, at least, is that just about everything is in my PATH. By everything, I mean every desktop application, including things like gnome-character-map and ...
10
votes
1answer
2k views

What are the .Trash-500 and .Trash-1000 directories?

I have a DNS-321 NAS drive which apparently runs Linux, so I logged in via ssh and I see .Trash-500 and .Trash-1000 directories. I realize that they're for trash, but why do I need two? Inside of them ...
10
votes
4answers
3k 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 ...
8
votes
3answers
2k views

How does the Linux file system/organization differ from Windows?

One of the things that really slows me down in catching on with Linux is the huge difference between the file system in Linux versus Windows. Up until the last 3-4 years I only used Windows systems ...
8
votes
4answers
2k views

Preferred mount points for internal HDDs

I am relatively new to Linux and I apologise if this is a silly question. I read the Linux FS Hierarchy document but it didn't answer my question. I would like to know if there is a typical drive ...
7
votes
1answer
3k 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 ...
7
votes
5answers
10k 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 ...
7
votes
2answers
3k views

How can you move (or copy) all files to a directory with the same filename prefix?

Using Bash So let's say I have a bunch of files randomly placed in a parent directory ~/src, I want to grab all the files matching a certain suffix and move (or copy) them to a ~/dist directory. ...
7
votes
3answers
5k views

Should I put application into /usr/local or /usr/local/share?

What are the "standards" -- should I put application (not just binary, but entire distribution) to /usr/local or /usr/local/share. For example scala or weka -- it contains examples, binaries, ...
7
votes
2answers
797 views

What's the origin of rc, rc.d, share, proc in Linux?

I don't think I am a newbie at all, but I still can't figure out many abbreviations' origin like rc, rc.d, share, proc... I've heard someone says rc is "run command", .d is directory, but I'm not ...
7
votes
1answer
574 views

What is the purpose of `/etc/group-`

On a standard Linux distribution (e.g. Ubuntu) there is usually /etc/group and /etc/group-, where the second one is only readable by root. man group only describes /etc/group. Thus my question: What ...
7
votes
3answers
3k views

File and directory naming conventions

I want to refactor the files and directories on my system. However I am not sure what is best practice. After reading this question and it's answers I assume the most important part is to be ...
7
votes
2answers
738 views

How can I copy a subset of files from a directory while preserving the folder structure?

I want to move some subset of files from dirA to dirB (let's say files with "blah" in the filename), but I want all the nested directories to be the same in the new location. How can I do that?
7
votes
1answer
4k views

Difference between lib, lib32, lib64, libx32, and libexec

My 64 bit Ubuntu 13.04 system has the following directories in /: lib lib32 lib64 libx32 libexec In the /usr directory there is: lib lib32 libx32 libexec This seemed like something that could be ...
6
votes
4answers
2k views

Where in “/” should extra disks be mounted?

According to Wikipedia http://en.wikipedia.org/wiki/Unix_directory_structure http://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard extra disks should not be mounted in /mnt/ according to the ...
6
votes
2answers
461 views

Why `.` is displayed by `ls`?

After reading the question When you type “ls -a”, what is the significance of “.” and “..”?, I have a similar one. Why to display .? I mean, is there any directory where cd . would not work? How is ...
6
votes
2answers
468 views

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
6
votes
2answers
1k views

Which is the best practice when replacing a system binary?

I'm working on Mac OS X which is shipped with several binaries mostly located in /usr/bin/ and /usr/sbin/. Since it doesn't have a native package manager like some Linux distros, I got used to ...
6
votes
2answers
5k views

How to copy only matching files, preserving subdirectories

Is there a way to do this: "How can I copy a subset of files from a directory while preserving the folder structure?", but without using rsync? Is it possible to be done using only cp, find and grep? ...
6
votes
2answers
235 views

Where should I place a downloaded tarball?

I have downloaded the ChromePlus tarball and extracted it to my home directory. The extracted folder contains an executable that I can double-click to launch ChromePlus. So I assume I do not need to ...
6
votes
2answers
166 views

Placement of application and user files on linux system

In which directories should I place the following? I have an application with few .net assemblies, a default database (containing default application settings), a directory with 100's of images, a ...
6
votes
2answers
498 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 ...
5
votes
3answers
368 views

When you type “ls -a”, what is the significance of “.” and “..”?

Whenever you type ls -a into the command prompt, you usually get all of your folders, files, and then you see that the first two entries are . and .. Just curious, but what is the significance of ...
5
votes
5answers
351 views

Which is better for installed applications: /usr/bin or user's home directory?

It's not entirely clear to me whether it would be better to install a GUI application in /usr/bin or my home directory. I've read through this article and this one, but it doesn't really talk about ...
5
votes
4answers
272 views

Ways to organize and access frequently visited directories and files?

In my Ubuntu, I have added some frequented directories to the bookmarks of Nautilus, for visiting them quicker. Nautilus can consume a lot of memory, when it has been kept open for long and there ...
5
votes
3answers
2k views

Mounting a device — role of /dev, /media and /mnt, and the mount command [closed]

I have several closely related questions about what happens when I insert a CD. The files on the CD /media/Ubuntu\ 11.04\ i386/, but from what I've seen /dev/cdrom is also involved. What is the ...
5
votes
1answer
149 views

Strange kind of “stealth” directory on Linux

I am in a Linux machine and am working with a directory that is aptly named "stealth", because it runs and hides! Take a look at this behavior: bash-3.2$ ls /net bash-3.2$ ls -la /net total 4 ...
5
votes
1answer
1k views

Where to install applications

I'm a long-time Windows user in the middle of a multi-year personal migration to Linux-based development. On Windows when I installed an application it got put in the Program Files folder and I'd ...