Sometimes, if we don't change the default permission in linux after we make a new file, that's can't be edited cause the file default perimission for the file is read only.I think it's not so comfort if each we make new file we should change the permission first if we want to edit that. We can use umask command to setup the default permission for the file that have been created/make. The Syntax is like this :
lambanx@fresh-IDEA # umask [permission]
Example :
I want to setting the default permission for the file that have been made to full access for user,group, and other
lambanx@fresh-IDEA # umask 777
the 7 number is represent full access permission for the file, why the there are three 7 number above? cause i would like to setting permission for user,group, and other.
Showing posts with label chmod. Show all posts
Showing posts with label chmod. Show all posts
Wednesday, January 14, 2009
Thursday, December 11, 2008
CHANGE FILE PERMISSIONS
Maybe, you find a file that's can't be deleted in Linux Operating system. In Linux, each of file has permissions/previleges for the owner, the group and the other.So no each one can open, modify or delete the file. Each file in linux has atribut, it will appears if you try to execute command that display a list of file in directory :

at the first column there are 10 character that's consist of :
1. first character is indicates type of file
- indicates that the type of the file is a regular file
d indicates that the type of the file is a directory
l indicates that the type of the file is a symbolic link
b indicates that the type of the file is a block special file
c indicates that the type of the file is a character special file
s indicates that the type of the file is a socket link
2. Three character after the first character is indicates the permission for user that owned the file (so based on the example above, the permission for user is read(r),write(w) and execute(x).
3. Three character after that is indicates the permission for group (so based on the example above, group don't have a permission for this file)
4. The last three character is indicates the permission for other(except user that owned the file and their group), so based on the example there is no permissions for other.
- How to change the permissions ?
1. Based on the example above, we would like to change the permissions for the group for read(r), and execute(x) the file. To change the permission we use 'chmod' command (change modifications). For example :
fresh-IDEA Downloads# chmod g+rx 93197-gotchione.tar.gz
So the result will be like that :

2. The '+' character is used for add a permission for the file, but the '-' character is used for remove a permissions for the file. Form example we would like to remove the read(r) permission for the user that owned the file :
fresh-IDEA Downloads# chmod u-r 93197-gotchione.tar.gz
So the result will be like that :

Subscribe to:
Posts (Atom)
