Skip to content
Advertisement

How to change the permission mode in Linux?

To grant read and write permissions to the owner and to remove execution permission from the group should it be two commands as,

chmod u +rw Test
chmod g -x  Test

or could it be can done in a single command?

Advertisement

Answer

$ chmod u+rw,g-x Test
$ ls -ls Test
0 -rwx-----x 1 dave  dave  0 Sep 30 09:28 Test
$ chmod -u-rw,g+x Test
$ ls -ls Test
0 ------x--- 1 dave  dave  0 Sep 30 09:28 Test
$ chmod u+rw,g-x Test
$ ls -ls Test
0 -rw------- 1 dave  dave  0 Sep 30 09:28 Test
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement