-
Cat View text content
Tac View text content as a flashback
Less View large text, you can use the search function, flip page
/word search down
?word Search
ctrl+f Page DOWN
ctrl+b page up
 J,K,G,G J cursor down one line, K cursor up one line, G moves the cursor to the first line, and G moves to the last row.
Head-n View the first few lines of a file
Tail-n View the last few lines of a file
-
File or directory properties
You can view files or destination properties
-rw-r--R--. 1 root root 3482 September 12 07:40 install.log.syslog
For example:
First:-Delegate file
d for directory
s for sockets
& Nbsp;l link file
 P pipe symbol
 B block device files, such as: hard disk, USB external connection device.
 C character device
2,3,4 bit is the permission of the file owner
5,6,7 the permissions of the group to which the file belongs
8,9,10 bit is the permission of the other person
Number 1 That represents a few files after the
Root represents the file to which the primary is the root
and then the root on behalf of the group that the file belongs to is root
After 3482 for file size
File permissions rwx=421, The newly created directory default permission is 755
The newly created file default permission is 644, that is, the file is a
with no execute permission. We use the Umask command to see the 666-022=644 of the 77-022=755
File umask=022 the
Directory.
-
Change permissions
1.chown change owner, owning group
chown username Change owner
chown:groupname Change owning group
chown username:groupname owner and group, change together.
chown-r The owning of all cascading directories also changes
2.chmod Change permissions (rwx)
u,g,o,a Rep: User,group,others,all.
u+r/w/x= added
u-r/w/x= minus
3.chattr
+a (append append, add) After setting this parameter, can only add data to the file, not delete, more for the server log file security, only root can set this property.
+i Add this permission, which is worse than the one above, and none of the additions.
View using the lsattr command, add the-r option to see which file has special permissions.
4.cat/etc/issue View System version number
uname-a View System kernel version number
yum update system upgrade version
yum-y The difference between update and YUM-Y upgrade is that the
yum update package, upgrade the system kernel and the system version
yum upgrade just upgrade the package, other unchanged
Set_uid,set_gid,sticky_bit Special Permissions
Suid has the permissions of the owner of the file, which is equivalent to owning the
Sgid has the permissions of the group to which the file belongs, equivalent to owning the file all groups in the operation
Stid set this permission, it is for the directory, if the directory is set stick bit (sticky bit), then the file in addition to the file creator and root user can delete and modify the/tmp directory stuff, other users cannot move others, this is the role of sticky bit.
Note: Sometimes you set the S or T permission, you will find it becomes s or T, this is because in that position you do not give it X (executable) permissions, so that the setting is not valid, you can first give it an X permission, and then give S or T permissions.
E. Search
This article is from the "My Linux Road" blog, so be sure to keep this source http://8641765.blog.51cto.com/8631765/1696144