span.fullpost {display:inline;}

Wednesday, October 1, 2008

FILE PERMISSIONS in Linux

In Linux we talk about "users" and "groups" I´m sure know about this.
They have different permissions regarding access to files. There is a clever way to see how permissions are set.

Remember the command "ls" it gave a list of all files in the directory you´re in, "ls -a" even did show all the hidden files as well.
CODE
$ ls -l


( Will give you the files in "long" format, try: )


CODE
$ ls -l /etc/gnome/gnomerc



This is what you will get:


QUOTE (Text @ Screen)
-rwxr-xr-x 1 root root 484 Feb 25 14:08 /etc/gnome/gnomerc



This does look a bit complicated but it really isn´t. The first 10 characters are built up like this:

- rwx r-x r-x

The first one tells you whether it is a file ( - ) a directory ( d ) or a link ( l )
The next three are for the "user" 'r'ead 'w'rite and e'x'ecute. The next three for the "group" and the last three for all "others"

The next 1 stands for the number of links to the file. The owner. The group. The size in bytes. The date and time of the last modification to the file. And the name of the file.


CODE
$ ls -al /home/deadmix


Will give a long list of all the files in your home directory and their permissions.
The list is even to long for your screen:
"ls -al /home/deadmix >permissions"
Places a textfile called permissions in your home directory, do print it out for further inspection, there is a lot to learn there.

0 comments:

Tutorialsland By - Templates4all | Free Blogger and web Templates
Free Website templatesFree Flash TemplatesFree joomla templatesSEO Web Design AgencyMusic Videos OnlineFree Wordpress Themes Templatesfreethemes4all.comFree Blog TemplatesLast NewsFree CMS TemplatesFree CSS TemplatesSoccer Videos OnlineFree Wordpress ThemesFree Web Templates