Page 1 of 1

Some Linux Essentials

Posted: Sun Jun 19, 2011 5:14 pm
by Ageek
Linux File System Hierarchy

Directories and the files are organized into a single rooted reverse tree structure. File system begins at the / directory. Names are case sensitive and all the path are delimited by ‘/’.
  • Home directories : /root, /home/username
    User Executable : /usr/bin, /usr/local/bin, /bin
    System Executable : /usr/sbin, /usr/local/sbin, /sbin
    Kernels and bootloader : /boot
    Configuration : /etc
    System information : /proc, /sys
    Server data : /var, /srv
    Libraries : /lib, /usr/lib, /usr/local/lib
    Mount points : /media, /mnt
    Temporary File : /tmp
.
??? bin
??? boot
??? dev
??? etc
??? home
??? lib
??? media
??? mnt
??? proc
??? root
??? sbin
??? srv
??? sys
??? tmp
??? usr
??? var


List the first level directories of the system.
tree -d -L 1

Linux naming convention
  • All characters are allowed except the forward slash
    Size of the name can be up to 255 characters
    Name are case sensitive
However, it is unwise to use certain characters in file name and directory names

Eg:
Access a file having special character in file name such as spaces

ls -l “Hello World”

OR

ls -l Hello\ World

File and Directory permissions
Users
  • Every user has an ID (unique number). User root has the ID 0. Normally UID start at 500s
    These details are stored in /etc/passwd
    Each user can get a home directory at /home
    User need permission to read files which owned by other user
Groups
  • Users are grouped into a user group
    Each group has unique ID; GID
    These information are stored in /etc/group
    All users in the same group can share the files each other


Linux access permission

This is totally based on the ownership where it has 3 levels

__ User (u)
|
Ownership _______ Group (g)
|
|__ Other (o)

This is also known as Discretionary Access Control (DAC). Users can perform 3 action on files and the directories

__ read (r)
|
File ________ write (w)
|
|__ execute (x)


__ list the content (r)
|
Directory ________ modify file and sub-dir (w)
|
|__ open, access move (x)

u g s | r w x | r w x | r w x

Re: Some Linux Essentials

Posted: Sun Jun 19, 2011 8:05 pm
by Neo
There is nobody I know better than you to teach us on Linux based OSs. Thanks for sharing.
Also it seems there will be more valuable articles to come in this category :)

Re: Some Linux Essentials

Posted: Sun Jun 19, 2011 9:00 pm
by Nipuna
Yes. I like Linux. I couldn't Reply first time. Now I did :)

Thanks Uditha Sir :)