Linux Questions & Answers – File Permissions – 2

This set of Linux / Unix questions and answers will be useful for anyone looking for sample questions and dumps on Redhat, CompTIA, LPI, Ubuntu and SuSE certification exams.

1. The permission -rwxr-xr-t represented in octal expression will be
a) 0777
b) 1755
c) 1754
d) 2754
View Answer

Answer: b
Explanation: None.

2. With a umask value of 112, what is the default permission assigned to newly created regular file?
a) —x–x-wx
b) -rw-rw-r–
c) -r-xr-x-r–
d) -rw-rw-r–
View Answer

Answer: d
Explanation: None.

3. Which command is used to assign read-write permission to the owner?
a) chmod a+r file
b) chmod o+r file
c) chmod u=rw file
d) chmod og-r file
View Answer

Answer: c
Explanation: None.
advertisement
advertisement

4. Given the command
$ chmod o-w datafile
a) sets write permission to everyone for datafile
b) sets write permission to others for datafile
c) clears write permission to everyone for datafile
d) clears write permission to others for datafile
View Answer

Answer: d
Explanation: None.

5. Which of these commands will set the permissions on file textfile to read and write for the owner, read for the group, and nothing for everyone else?
a) chmod 046 textfile
b) chmod 640 textfile
c) chmod 310 textfile
d) chmod rw r nil textfile
View Answer

Answer: b
Explanation: None.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

6. If you are a root user, how can you grand execute permission only for the owner of the file project1?
a) chmod +x project1
b) chmod u+x project1
c) chmod a+x project1
d) chmod U+X project1
View Answer

Answer: b
Explanation: None.

7. A user executes the following command successfully:
$ chmod +x file1.txt
Which of the following is true of the output of this command?
a) The command results in adding execute permission to the user who ran this command
b) The command results in adding execute permission for the owner of the file
c) The command results in an error since the file is not an executable file
d) The command results in adding execute permission for all users (i.e., user,group & others)
View Answer

Answer: d
Explanation: None.
advertisement

8. What does chmod +t do?
a) wrong syntax
b) set effective userid for filename
c) set effective groupid for filename
d) set the sticky bit
View Answer

Answer: d
Explanation: None.

9. Which of the following umask settings doesn’t allow execute permission to be set by default on directory files
a) 222
b) 111
c) 000
d) 444
View Answer

Answer: c
Explanation: None.
advertisement

10. Which of the following umask settings allow execute permission to be set by default on regular files
a) 222
b) 111
c) 000
d) None of the mentioned
View Answer

Answer: d
Explanation: None.

11. The command chmod 4777 a.out
a) will set the suid bit of a.out
b) will set the suid bit of a.out only if the command is issued by root
c) is not a valid command
d) will set the sticky bit of a.out
View Answer

Answer: a
Explanation: None.

Sanfoundry Global Education & Learning Series – Linux Administration & Programming.

Here’s the list of Best Books in Linux Commands & Shell Programming.
Here’s the list of Best Books in Linux Kernel, Device-Drivers & System Programming.

To practice all questions on Linux Administration & Programming, here is complete set of 1000+ Multiple Choice Questions and Answers on Linux.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.