Sunday, July 19, 2015

File Management in Linux

File Permission


- rwx rwx rwx


- means file
r means read
w means write
x means excute
first rwx is for user permission
next rwx is for group permission
and last rwx is for other permission

- means permission is for file
d means permission is for directory
l means for links
p means for process file
s means for socket file
b means for block device
c means for character device
Note:if permission started with d instead of - .It means particuler permission is for directory.


 




How to change the file or directory permission

 

chmod command is used to change the permission
File or Directory permission can be change in two ways
Method 1
chmod
eg:
1 : if user file permission change from rwx to rw only
chmod u+rw filename
2 : if user and group file permission change from rwx to rw only
chmod ug+rw filename

Method 2
chmod
eg:
1 : if user file permission change from rwx to  rw only  ,group file permission change from rwx to r only and other file permission change from rwx to r only
chmod 644 filename


 

Changing file ownership

You can change the owner of a file by using the chown command
chown  
eg:
1 :  I wanted to change the owner of file from "Haktuts" to "hak".
chown hak filename

Changing group ownership
You can change the owner of group by using the chgrp command
chgrp  
eg:
1 :  I wanted to change the owner of group from "Haktuts" to "hak".
chgrp hak filename

changing user and group ownership
chown : filename
eg:
if user want to change both user and group ownership
chown haktuts:hak filename
 

No comments:

Post a Comment

Evil Twin attack

Evil Twin Attack is attack is frequently carried upon wireless access points with malicious intentions. This attack happens when...