Examples

  1. chmod -w *

    Reset the write permission for all of the files in the current directory, making them read-only.

  2. chmod -R -w *

    Reset the write permission for all of the files in the current directory and in all subdirectories, recursively.

  3. chmod +ha *.exe

    Make the .exe files in the current directory hidden, and set their archive bits.

  4. chmod -a *.c

    Reset the archive attribute for all of the .c files in the current directory.

  5. chmod =sh /*

    For all of the files in the root directory, set their system and hidden attributes and reset their write permission and archive attribute. When complete, the files will be unwritable (read-only), system, and hidden, and their archive attributes will be zero.