ls -l report.txt begins with -rw-r-----.
Determine the owner, group, and other permissions.
Which combination is correct?
-rw-r----- denotes a regular file with owner rw-, group r--, and others ---.
Detailed explanation
Correct. The owner can read and write, the group can read, and others have no permissions.
Incorrect. The mode does not give the group write or others execute.
Incorrect. The group does not have write permission and others do not have read permission.
Incorrect. Only the owner and group have read permission in this mode.
Try it yourself
An example you can run in a temporary verification environment.
tmp=$(mktemp); chmod 640 "$tmp"; stat -c '%A %a' "$tmp"; rm -f "$tmp"Expected result
-rw-r----- 640Key points
- The first character is the file type
- Owner, group, other follow
- r=4, w=2, x=1
Notes
- Environment: GNU coreutils 9.x / 一時ファイル
- Use a disposable file or directory when checking chmod calculations.
- Exact permission display can vary slightly with filesystem and distribution defaults.
Foundation review
Place the operation
The nine permission characters are read as owner, group, and other triplets after the file-type character.
Check the side effect
Translate each triplet independently before converting permissions to an octal value.