How do you change the access permission (add group read/write) to all the files in the current directory containing the word "cali" in their names?
-
chmod g+rw cali
-
setperm r+w cali
-
chmod 0060 cali
-
chmod u+x calli
The command 'chmod g+rw cali' adds group read (r) and write (w) permissions to all files matching the pattern 'cali' in the current directory. The g+rw syntax specifically targets group permissions with + adding permissions. Option C uses octal mode incorrectly, and D targets user permissions with wrong filename pattern.
To change the access permission (add group read/write) to all the files in the current directory containing the word "cali" in their names, you can use the chmod command with the appropriate options.
Let's go through each option to understand why it is correct or incorrect:
Option A) chmod g+rw *cali* - This option is correct because it uses the chmod command to add read and write permissions for the group on all files in the current directory that contain the word "cali" in their names. The g+rw part of the command means "add read and write permissions for the group".
Option B) setperm r+w *cali* - This option is incorrect because there is no setperm command in most operating systems. Additionally, the syntax r+w is incorrect for adding permissions.
Option C) chmod 0060 *cali* - This option is incorrect because it sets the permissions for the owner and group to read and write only, and removes all permissions for others. The 0060 part of the command means "set the owner's permissions to read and write only, and remove all permissions for the group and others".
Option D) chmod u+x *calli* - This option is incorrect because it adds execute permission for the owner on all files in the current directory that contain the word "calli" in their names. The u+x part of the command means "add execute permission for the owner".
The correct answer is Option A) chmod g+rw *cali* because it correctly adds read and write permissions for the group on all files in the current directory that contain the word "cali" in their names.