1. View and modify file permissions (1) view file details, including permissions
Command: Ls-l
- The first character represents the file type: D represents the directory,-represents a non-directory.
- The next 9 characters, each of three, represent the permissions of the owner of the file, the permissions of the same group of users, and the permissions of other users. R means have Read permission, W means write permission, x indicates execute permission,-Indicates no permission.
- The next number represents a reference count.
- The next two names are the file owner and the owning user group, respectively.
- The next number indicates the file size, in bytes.
- The next three columns are time: months-days-hours.
- Finally, of course, the file name.
(2) Modify file permissions
command example: chmod 754 nohup.out
- 4 represents Read permission, 2 for Write permission, and 1 for execute permission.
- 7 = 4 + 2 + 1, which indicates a readable writable executable permission; 5 = 4 + 1, which means that you have read executable permission but no write permission; 0 means no permissions.
- The three numbers correspond to the rights of the file owner, the owning user group, and other users.
2.ls Command Usage Summary (1) Common parameter meanings
- Without parameters: Lists all filenames under the directory by default
- -L: List details of directories and files (note, LL equals Ls–l)
- -A: List everything under the directory, including hidden
- -T: Sort by last modified time
- -S: Sort by file size (S in uppercase)
- -r: Sort by reverse order
- -S: List file sizes
Summary of Common Linux commands