844 views

Which UNIX/Linux command is used to make all files and sub-directions in the directory "progs" executable by all users?

1. chmod - R a + x progs
2. chmod - R 222 progs
3. chmod - X a + x progs
4. chmod - X 222 progs

### 1 comment

A simple search on how chmod works should give your answer. Also if you're on a Linux or *NIX based computer, just search "man chmod? in your terminal to know how it works.

chmod -R a+x progs

this will make all files and sub-directories in the directory (progs) executable by all users.

-R is for recurssive calls, so that sub-directories within the directories can be accessed.

a is for all users

+x is for making things executable

----------

A total of 10 bits are used to represent file permissions

d/f,rwx,rwx,rwx

First bits tell whether the file is directory or not. If it is 1 then directory else file.

rest 9 bits are divided into three sections. First section is permission for current USER, the second one for the group to which the user belongs and the last one to others.

Each section has 3 bits,

If first bit is set then it is readable, second bit is for writable and last bit is for executable.

Option (1) is correct.

1
551 views