Computing.Net > Forums > Linux > Best way to organize files in Linux

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Best way to organize files in Linux

Reply to Message Icon

Name: rturro
Date: April 21, 2006 at 02:48:09 Pacific
OS: SuSe 10.0
CPU/Ram: Athlon 2100+/1024 MB
Product: Asus
Comment:

In Windows, one (not always but usually) keeps documents in My Documents, videos in My Videos, pictures in My Pictures, etc. etc.
However, when reading Linux documentation, I have not so far come across any good logical explanation of how [personal] files should be arranged in Linux (to be fair I must admit I have not read a lot but..).

If someone could give me an example of a good logical file hierarchy in a Linux syste, I'd much appreciate. A screenshot, link etc. will all work.

What I've found so far is just general information on how Linux approaches the issue of file structuring ("/ is for root, /etc/ for this /lib for this etc.).



Sponsored Link
Ads by Google

Response Number 1
Name: 3Dave
Date: April 21, 2006 at 03:52:38 Pacific
Reply:

You should keep your personal files in your home directory which will be located under /home, it will be called your username, eg /home/rturro. Create more directories in there for videos, music etc. You can shorten your home directory to ~, eg "ls ~/pictures" will list everything in /home/rturro/pictures.


0

Response Number 2
Name: rturro
Date: April 21, 2006 at 08:11:39 Pacific
Reply:

3Dave,

thanks for getting back on this. I have found a few informative sources on Linux directory structure as well as the Linux Filesystem Standard. It is not that hard actually, and does not much differ from the approach taken in Windows (just as one logical thing does not differ much from another logical thing).

I have one more question though. Is it, generally, a good practice to mess around with directories OTHER than /home/rturro?
For instance, I have a number of doc files which I need to store somewhere (let's call this directory "My Project files"). If I had two options to choose from, which one is more advisable:
(1) /home/rturro/Docs/My Project files/; or
(2) /usr/info/My Project files/
Pretty much sure option (1) would be more correct, but still asking, just out of curiosity and to prove/disprove my guess.


0

Response Number 3
Name: 3Dave
Date: April 21, 2006 at 16:18:33 Pacific
Reply:

You are correct in thinking number 1 would be better....but not if you want to share your documents with other users as your home directory should not be accessible by anyone else.

General rules of thumb:
/bin = low level programs such as ls, fdisk, passwd etc. /bin is usually on the same partition as / (root)
/usr/bin = other programs which are not needed at boot time (ie it can be stored on a separate partiton) such as mplayer, mozilla etc.
/usr/local/bin = usually programs specific to the actual machine. If I create scripts or compile my own programs I will usually put them in here....it is accessible by all users.
The same goes for /sbin, /usr/sbin etc but they are programs normally only allowed to be run as root.
/lib = basic shared libraries
/usr/lib = additional libraries
/usr/local/lib = ...you're getting the picture!
/etc = configuration files
/var = files which often change such as logs
/mnt = where devices, network shares etc are mounted
/proc = interface to kernel
/home = where user directories are stored
/tmp = temporary files
/dev = devices: drives, ports etc
/opt = optional stuff. Sometimes you'll find things like KDE or java installed there
/root = root's home directory
/boot = kernels and other boot files
There are others too, pretty much everything in GNU/Linux is treated as a file. For more detail:
http://www.tldp.org/LDP/intro-linux/html/sect_03_01.html


0

Response Number 4
Name: rturro
Date: April 22, 2006 at 04:16:08 Pacific
Reply:

3Dave,

thanks for the info.
cheers


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: Best way to organize files in Linux

find file in linux www.computing.net/answers/linux/find-file-in-linux/9503.html

How to OPEN+RUN .exe files in Linux www.computing.net/answers/linux/how-to-openrun-exe-files-in-linux/16329.html

playing WMV files in Linux? www.computing.net/answers/linux/playing-wmv-files-in-linux/2576.html