Whats easy way to change file permission in Linux

5

I don't want to remember codes like 777 all the time . is there any intuitive way to chnage file permission

Suppose i want to have

user --rwx
group --rx
others x

how can i write this way like

chmod ugo +rwxrxx

I don't want to keep previous permissions

Mirage

Posted 2011-05-27T07:18:36.753

Reputation: 2 563

Answers

3

Since you don't want to keep the old permissions, use this:

chmod u=rwx,g=rx,o=x FILE

Teddy

Posted 2011-05-27T07:18:36.753

Reputation: 5 504

6

You should read man page for chmod. There is example:

chmod u+rwx,g+rx-w,o+x-rw filename

AlexD

Posted 2011-05-27T07:18:36.753

Reputation: 194

9He didn't want to keep previous permissions, so chmod u=rwx,g=rx,o=x is better. – Teddy – 2011-05-27T07:32:36.070

@Teddy , thanks i like ur solution , i didn't knew i can use = – Mirage – 2011-05-27T07:37:28.990