Umask 003 Directory permissions for 774 files for 664 files are odd when the results are calculated by default in addition to 1
Catalog files
rwx rwx rwx 777 rw-rw-rw-666
-------WX 003-----WX 003
rwx rwx r--774 rw-rw-r--664 (rw-minus-wx-no number will be reduced)
Special permission bit: suid: After the executable binary has suid permissions, anyone who executes the file can temporarily have the permissions of its owner.
Setup mode chmod u+s
Sgid: After the executable binary has GUID permissions, anyone who executes the file can temporarily have the permissions of its owner.
Normal is the owner can modify the file or directory permissions. After the directory has Sgid permissions, the owning group of the inherited directory of the files created by anyone in that directory can be shared.
Setup mode chmod g+s
Sticky: After the directory has Sticky permissions, the files and subdirectories in that directory, only the owner and root of its owner and directory can be deleted.
Setting mode: chmod space o+t
chmod space u=rwx space file name or directory name means modify everyone rights to full permissions
chmod space g=r--space file or directory name indicates that modify belongs to group permission is read-only
chmod space o=r--space file or directory name means modify other people permissions to read-only
chmod 777 Plus name change owner permission
chmod U–RW plus name Delete Read and Write permissions
Chown newname Modify the master name (only root is available)
Lsattr Space + file name view A and I special permissions
Chattr +a cannot be modified, can be appended, cannot be deleted
Chattr +i do nothing but read
Access Control List ACL
Create New partition: FDISK/DEV/SDA
Entering N returns is the creation of a new partition, then enter
Default value is not filled, enter
The end value is the maximum value input 1G, enter
Enter W save, enter 8
Effective command: PARTX-A/DEV/SDA notification System Let the kernel reread the partition table
Enter Ls/dev/sda6 to see if/DEV/SDA is successful
Format: Mkfs.ext4/dec/sda6
Text Tool
RZ Windows file upload to Linux
ZR Linux file uploaded to Windows
Grep
Getent passwd User name view passwd information
Getent Shadow User name View shadow information
Getent Group and Group name view groups information
Useradd-c "description Information"
cd/etc/skel/user created directory by default from
Head-2 is to display the first two lines tail-2 is to display the last two lines
Tr-s ""% convert space to%
Cut-d (after adding the content to be cut such as: space%, etc.)-F3 is showing the 3rd column
Text Processing Three Musketeers
grep text filtering
Sed text Editing Tool
Implementation gawk on awk Linux, Text Report Builder.
Grep
Regular Expressions: Double or single quotation marks are required
1. Display lines starting with size s in the/proc/meminfo file (required: use two methods)
Grep-i "^s"/proc/meminfo-i case insensitive
Grep-e ^s-e ^s/proc/meminfo-e or
2. Display lines in the/etc/passwd file that do not end in/bin/bash
Grep-v "/bin/bash$"-V shows rows that are not matched
3. Show user RPC default shell program
grep "^\<rpc\>"/etc/passwd |cut-d:-f7 line anchor ^ \<rpc\> match entire word regular expression required "" and enter path pipe character | Last cut-d: Specify delimiter: Extract 7th Column
4. Find out the two-bit or three-digit number in/etc/passwd
-O: Show only the matching string
Grep-o "[0-9]{2,3}"/etc/passwd {2,3} means matching the preceding character (0-9) at least m times, up to N times
5. A line that displays at least one whitespace character in the CentOS7/etc/grub2.cfg file, followed by a non-whitespace character
grep ^ "[[: blank:]]+] [[: Graph:]]/etc/grub2.cfg
6. Find the line that ends with ' LISTEN ' followed by any number of whitespace characters in the result of the "Netstat-tan" command
Netstat-tan|grep "\<listen\>[[:blank:]]*"
7. Display user name and UID of all system users on CentOS7
Grep-v "[[:d Igit:]]" {4}/etc/passwd|cut-d:-f1,3
8, add user bash, Testbash, basher, SH, nologin (its shell is/sbin/nologin), find the/etc/passwd user name with the shell name of the line
9, take advantage of DF and grep, remove the disk partition utilization, and from large to small sort
DF |tr-s "" |cut-d ""-f5,6|sort-r
Nineth Shell Script Programming Basics
Set View Local Variables
A=123
Export=a turn it into an environment variable
ENV View Environment variables
0 Simple commands for Basic Learning Linux (second week)