Multiple choice unix

Which command is used to make all files and sub-directories in the directory (progs) executable by all users?

  1. chmod -R a+x progs

  2. chmod -R 222 progs

  3. chmod -1 a+x progs

  4. None of the above

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

chmod -R a+x progs makes all files and subdirectories (-R for recursive) executable for all users (a+x = all users + execute). chmod -R 222 would give write-only, not execute. chmod -1 is invalid syntax (should be -R). The command in A is the correct way to recursively set execute permissions.