Last Updated on February 24, 2021 by InfraExam
A user issues the Linux command ls -l myfile.sh to check the permission of the file myfile.sh.
devasc@labvm:~/Documents$ ls -l myfile.sh
-rwxr-xr– 1 self test 15 Mar 30 21:24 myfile.sh
Which two statements describe the permissions assigned to the file? (Choose two.)
- Any user in the test group can execute the file.
- The user with the user ID of self can modify the file.
- The user with the user ID of devasc can modify the file.
- Any user in the self group can read, modify, and execute the file.
- All users can execute the file.
Answers Explanation & Hints:
ls -lcommand provides a “long list” format with more information that includes the following:
File type: The hyphen (-) represents a regular file, the d represents a directory.
File permissions: The first three letters represent the permissions of the file owner over the file, the next three letters represent the permissions of the group over the file, and the last three letters represent the permissions of others over the fie. The permission letters are as follows:
r- read or copy the file
w- write to the file
x- execute the file
hyphen (-) – no value assigned
Number of hard links to the file: 1 in this case
File owner, self in this case
File group: test in this case
File size. 15 bytes in this case