1, File Content Lookup command: Cat, TAC Nl,more, Less,head,tail, OD
A lookup parameter for the file, showing how the line number displays the line number
All parameters in NL are about how line numbers are displayed
Less in this function more, more flexible: Space next page pageup page pagedown next page/string string query? string Reverse strings Query
Man's command is to call less to display the
Tail-f will always detect the update of the file, show the update of the file in real time unless CTRL + C stops
Head-n 20/etc/man.config | Tail-n 10 shows the contents of the Man.config file from 11 rows to 20 rows
OD for displaying non-plain text files
2. Find Files
Find path-name "filename" find is not very common, because it is slow, it directly looks for the hard disk
Find can specify a time range for a file
You can specify a file name
You can specify the file owner, group
You can specify permissions for a file
You can specify the size of the file
You can use wildcard characters to find a file *
The-exec command directly processes the lookup results Find/-perm +7000-exec ls-l {} \;
The end of the delegate command
Can be found later with multiple directories
You can already find subdirectories
Find files generally use Whereis, locate they use Linux database files (Linux will record all of the system's files in a database file)
But this database will only be updated automatically once a day, so to use locate and Whereis to find the latest files, you need to update the database file UpdateDB (This is also relatively slow)
Whereis Specifying file types
Locate-i ignoring case
Locate-r-Regular expression
3, Touch
Create a new file
Modify the file's Mtime atime cannot modify the file CTime you use touch to make any changes to the time will make CTime update to the current
4,LL is Ls-l's abbreviation.
Ls-l--time=atime
Ls-l--time=ctime
5, you can enter several commands consecutively in one row, separated by semicolons
6. view file type filename
7, default permissions for file 666, default permissions for directory 777
Umask is the default permission that needs to be subtracted from the permission note, using symbol subtraction
Umask View
Umask 002 Modifications
8, whether the hidden properties of the file can be modified, etc.
Modify Chattri +/-/= a/i ...
View Lsattri
9, Shell script simply executes a number of binary execution file redeployment. Suid cannot be used on shell script
10,suid existence Process: When a file/directory is to be manipulated for another file/directory
Users can convert identities, become owner identities or user groups, and get the appropriate permissions
Corresponding display: Ls-l SUID is the owner of the X into S
Valid only for binary files
Sgid is the user group's X becomes S
When the directory has Sgid permissions, the user group name of the newly created file in this directory is the same as the user group name of the directory
Facilitates group development
Sbit has the w,x right to the directory you can only modify what you create
Corresponding display: Ls-l other x changes to T
Set the above three permissions, chmod 4777 plus one digit SUID 4,sgid 2,sbit 1
Note that these three permissions are added when there is already a corresponding x, and if no x is added, the property is empty to show uppercase S or t
11, enter two consecutive tabs to query the executable command
Su Space-space username switch identities
The which command finds the full path of the user's command based on path
Brother Bird's Linux private dishes study notes---7th-2