Changing File Access Permissions with chmod

Your use of chmod can be greatly extended through one simple parameter: -c. This instructs chmod to print a list of all the changes it made as part of its operation, which means we can capture the output and use it for other purposes. For example:

matthew@seymour:~$ chmod -c 600 *mode of '1.txt' changed to 0600 (rw------)mode of '2.txt' changed to 0600 (rw------)mode of '3.txt' changed to 0600 (rw------)matthew@seymour:~$ chmod -c 600 *matthew@seymour:~$

There the chmod command is issued with -c, and you can see it has output the result of the operation: Three files were changed to rw------ (read and write by user only). However, when the command is issued again, no output ...

Get Ubuntu Unleashed 2015 Edition: Covering 14.10 and 15.04, Tenth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.