December 2012
Intermediate to advanced
888 pages
48h 24m
English
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 is returned. This is because ...
Read now
Unlock full access