]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
doc: add chmod examples
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 27 Mar 2012 15:52:20 +0000 (08:52 -0700)
committerAssaf Gordon <assafgordon@gmail.com>
Wed, 17 Oct 2018 20:31:04 +0000 (14:31 -0600)
Discussed in https://bugs.gnu.org/11043 .

* doc/coreutils.texi (chmod invocation): Add examples.

doc/coreutils.texi

index 16768cbca4ad1da9ad6db19d0582c9d5e5086611..512443aa68b6bd6b52dd2527b84e06c995bf7a6b 100644 (file)
@@ -11337,6 +11337,24 @@ Recursively change permissions of directories and their contents.
 
 @exitstatus
 
+Examples:
+
+@smallexample
+# Change file permissions of FOO to be world readable
+# and user writable, with no other permissions.
+chmod 644 foo
+chmod a=r,u+w foo
+
+# Add user and group execute permissions to FOO.
+chmod +110 file
+chmod ug+x file
+
+# Set file permissions of DIR and subsidiary files to
+# be the umask default, assuming execute permissions for
+# directories and for files already executable.
+chmod -R a=,+rwX dir
+@end smallexample
+
 
 @node touch invocation
 @section @command{touch}: Change file timestamps