|
Best Porn Sites | Live Sex | Register | FAQ | Search | Today's Posts | Mark Forums Read |
Linux Help For Linux users and nerds like TimmyW |
|
Thread Tools |
29th December 2009, 20:45 | #1 |
Junior Member
Addicted Join Date: Dec 2009
Location: USA
Posts: 265
Thanks: 905
Thanked 713 Times in 209 Posts
|
Filesystem Hierarchy
Since Linux is UNIX-like kernel, its hierarchy is very similar which is a very good thing.
Last edited by sexyb3rry; 30th December 2009 at 08:47.
Reason: oops
(MacOS, I believe is actually UNIX, not a clone like Linux is. So it shares the same hierarchy) If you have a Linux OS or a Mac OS, and you go to the very 'top' of your directory you will end up in "/". (These apply to all Unix-like and Unix-clones systems.) '/' stands for 'root'. This is at the very top of your filesystem structure. everything else in your system will be contained starting here. The most common directories are: Code:
it all begins with '/' (root) /bin /boot /dev /etc /home /lib (32bit libraries) /lost+found /media /mnt /opt /proc /root /sbin /srv /tmp /usr /var * Notice how each of those folders have a '/' before them because the '/' is at the top. Nothing is above root (/) Each directory has its own purpose, but since this is a very, very long topic I will post in a daily basis rather than in one post. |
|
30th December 2009, 07:55 | #2 |
Junior Member
Addicted Join Date: Dec 2009
Location: USA
Posts: 265
Thanks: 905
Thanked 713 Times in 209 Posts
|
Intro
Everyone of these directories has a a "file permission" which lists who has access to do what with the file or directory.
Last edited by sexyb3rry; 30th December 2009 at 08:47.
The result will look something like this: Code:
dr-xr-xr-x. 2 root root 4096 2009-12-22 09:15 bin dr-xr-xr-x. 5 root root 1024 2009-12-21 21:33 boot drwxr-xr-x. 19 root root 4320 2009-12-30 00:20 dev drwxr-xr-x. 113 root root 12288 2009-12-30 00:21 etc drwxr-xr-x. 4 root root 4096 2009-12-08 23:24 home dr-xr-xr-x. 10 root root 4096 2009-12-09 01:13 lib dr-xr-xr-x. 9 root root 12288 2009-12-22 09:15 lib64 drwx------. 2 root root 16384 2009-12-08 23:09 lost+found drwxr-xr-x. 2 root root 4096 2009-12-21 23:19 media drwxr-xr-x. 7 root root 4096 2009-12-09 12:40 mnt drwxr-xr-x. 2 root root 4096 2009-08-25 13:06 opt dr-xr-xr-x. 176 root root 0 2009-12-30 00:20 proc dr-xr-x---. 6 root root 4096 2009-12-29 14:24 root dr-xr-xr-x. 2 root root 12288 2009-12-22 09:15 sbin drwxr-xr-x. 7 root root 0 2009-12-30 00:20 selinux drwxr-xr-x. 2 root root 4096 2009-08-25 13:06 srv drwxr-xr-x. 13 root root 0 2009-12-30 00:20 sys drwxrwxrwt. 64 root root 4096 2009-12-30 00:33 tmp drwxr-xr-x. 14 root root 4096 2009-12-08 23:15 usr drwxr-xr-x. 21 root root 4096 2009-12-08 23:22 var Code:
ls -l / The command means ls = list -l = long format (this lists the full info about the directory or file) / = The root directory which we wanted listed. You can replace this with a different directory or file. Output might look confusing but it's actually pretty easy. Here is one line of it: Code:
drwxr-xr-x. 4 root root 4096 2009-12-08 23:24 home the 'd' tells you it's a directory. If there was a '-' instead of a 'd' it would mean it's a file. r = read w = write x = execute - = Replaces "r", "w" or "x" if according access type is denied The first character is file type. The next three are the permissions for the "owner" of the file. Second three are permissions for the "group" and last three are the permissions for others. Owner Group Others Code:
drwxr-xr-x Code:
drwxr-xr-x. 4 root root 4096 2009-12-08 23:24 home 4 = Number of directories Root = is the owner and/or creator of the file/directory Root = Group of users the file/directory it belongs to 4096 = Size of file/directory in Megabytes ( I assume...) 2009-12-08 23:24 = Date created or modified home = name of file/directory all the info belongs to. (I'm not sure what the "." means... maybe timmy or videodrone can help. When a file or directory in Linux has a "." in the beginning, it means it is a hidden file/directory. But not sure why the period is there ) This is it for now More tomorrow... |
17th January 2010, 01:14 | #3 |
Junior Member
Addicted Join Date: Dec 2009
Location: USA
Posts: 265
Thanks: 905
Thanked 713 Times in 209 Posts
|
|
The Following User Says Thank You to sexyb3rry For This Useful Post: |
27th March 2010, 18:15 | #4 |
Newbie Join Date: Dec 2009
Posts: 42
Thanks: 151
Thanked 64 Times in 29 Posts
|
Bit of thread necromancy, but...
You also have at least one non-standard distro, GoboLinux. http://gobolinux.org/ - does not use the standard hierarchy. |
The Following User Says Thank You to worthiness For This Useful Post: |
27th September 2010, 12:46 | #5 | |
Virgin Join Date: Sep 2010
Posts: 6
Thanks: 8
Thanked 9 Times in 5 Posts
|
Quote:
|
|
27th September 2010, 13:13 | #6 | ||
Virgin Join Date: Sep 2010
Posts: 6
Thanks: 8
Thanked 9 Times in 5 Posts
|
Quote:
The '4096' is actually the size of the directory file, in kilobytes. If you want to find out how much data is held in the directory (including the directory file), then you can do (eg) Code:
du -sm /home The '4' is actually the number of hard links to the directory. Every directory will have at least two hard links (one for the usual name, and one for .). Every time a directory is created underneath it, then a new hard links for .. will be created. Quote:
Cheers |
||
The Following 3 Users Say Thank You to monogroover For This Useful Post: |
18th October 2010, 17:46 | #7 |
Virgin Join Date: Sep 2010
Posts: 6
Thanks: 8
Thanked 9 Times in 5 Posts
|
No, sticky bits aren't extended attributes, they are standard. EA's can be used for example to establish access control lists but there are potentially lots of uses.
|
The Following User Says Thank You to monogroover For This Useful Post: |
16th November 2010, 16:55 | #8 |
Junior Member
Virgin Join Date: Nov 2010
Posts: 2
Thanks: 0
Thanked 1 Time in 1 Post
|
Very nice little intro to the Linux/UNIX filesystem. Just a little side note, if anyone wants a quick up-to-speed with Linux/UNIX commands and navigating around, see:
http://freeengineer.org/learnUNIXin10minutes.html Then you might be able to move around the system a lot better and understand what's actually held in the directories sexyb3rry describes. |
26th October 2015, 15:56 | #10 |
Junior Member
Newbie Join Date: Oct 2015
Posts: 21
Thanks: 6
Thanked 37 Times in 11 Posts
|
Thanks for the info.
|
Thread Tools | |
|
|