System command:
Date: displays the current date and time.
Cal: displays the calendar of the current month.
Cal 2001: 2001 AD Tib.
Cal 5 2001: displays the calendar month of May 2001 AD
Cal-m: displays the calendar of this month on Monday, the first day of each week.
Cal-jy: indicates the number of days since January 1, January 1.
Uptime: displays the system running time from startup to now
W: The logon user is displayed.
Whoami: view your current user name
Finger user: displays user-related information.
Uname-a: displays kernel information.
Cat/proc/cpuinfo: View cpu Information
Cat/proc/meminfo: view memory information
Man command: displays the command instruction manual.
Df: Displays disk usage
Df-h
Du: displays the directory space usage
Free: displays memory and swap zone usage
File Permission:
Command name: chmod
Usage: chmod [-cfvR] [-- help] [-- version] mode file...
Note: file access permissions for Linux/Unix are divided into three levels: file owner, group, and others. Chmod can be used to control how files are accessed by others.
Calculation:
Mode: permission setting string in the following format: [ugoa...] [[+-=] [rwxX]...] [,...], the u table shows the owner of the file. g indicates that the owner of the file belongs to the same group.
+ Adds a permission.-indicates that the permission is canceled. = indicates that the permission is unique.
R indicates that the file can be read, w indicates that the file can be written, and x indicates that the file can be executed only when the file is a subdirectory or the file has been set to executable.
-C: if the permission of the file has been changed, the change action is displayed.
-F: Do not display an error message if the file permission cannot be changed.
-V: displays details of permission changes.
-R: Change the permissions of all files and sub-directories in the current directory in the same way (that is, change one by one in the way of delivery)
-- Help: displays auxiliary instructions
-- Version: displays the version.
Example: Set the file file1.txt to readable by all users:
Chmod ugo + r file1.txt
Set file1.txt to readable:
Chmod a + r file1.txt
Set file1.txt and file2.txt as the owner of the archive, which can be written to the same group to which the archive belongs, but not to others:
Chmod ug + w, o-w file1.txt file2.txt
Set ex1.py to only the owner of the file to execute:
Chmod u + x ex1.py
Set all files and subdirectories in the current directory to be readable by anyone:
Chmod-R a + r *
In addition, chmod can use numbers to indicate permissions, such as chmod 777 file.
Syntax: chmod abc file
A, B, and c each have a number, indicating the permissions of User, Group, and Other.
R = 4, w = 2, x = 1
If you want the rwx attribute, 4 + 2 + 1 = 7;
If the rw-attribute is required, 4 + 2 = 6;
If you want the r-x attribute, 4 + 1 = 7.
Example:
Chmod a = rwx file
And
Chmod 777 file
Same effect
Chmod ug = rwx, o = x file
And
Chmod 771 file
Same effect
If you use chmod 4755 filename, you can grant root permissions to this program.