"Linux system explaining" Learning Summary (ii)
This summary, I will take a summary, the contrast of the way at a glance, the first to summarize all the commands together, and then a comparative summary of some knowledge points, and finally talk about this week's learning experience.
First, Linux system explaining common commands
Format: Command function command: command syntax ;#注释说明或者补充
Example: Create directory mkdir:mkdir-m/p directory name;
Create directory mkdir:mkdir-m/p directory name;
Delete directory rmdir:rmdir-m/p directory name;
rm:rm-r Directory name = RmDir; #系统会询问是否删除;
rm-f directory name; #强制删除;
Copy cp:cp source file target file;
Move or rename the MV:MV option source file/directory destination file/directory
File View cat:cat option file name; #-n Displays the line number screen;-A includes all content, including special characters;
File/Directory properties ls:ls options file or directory; #-l Soft link file;-D block device;-c process device;-s process communication;-P pipeline file;-Normal file;
Change file permissions chmod:chmod XYZ file name; # XYZ represents numbers; Rwz specific rules: r=4,w=2,z=1,-= 0; specific algorithm: rwz=r+w+z;
Change the file name of the main chown:chown-r account name or: Chown-r account name: Group name file name; #-r only suitable for the directory function is cascading changes;
File-Hidden Properties chattr:chattr [+/-/=][a/s/a/c/i][file/directory];# +-=: Increment, decrease, set, or add this property, the atime of the file or directory will not be modified, and when this property is added, data is written to disk synchronously A add this property, can only append cannot delete, non-root user can not set this property, C automatically compress the file, read automatically decompression, I added, so that the file can not be deleted, renamed, set link, write, add data;
Search for Find:find path parameters;
Added user useradd:useradd-u (UID)-G (GID)-D (HOME)-m-s;
Delete User Userdel:userdel-r username;
Added group Groupadd:groupadd-g (GID) groupname;
Delete Group Groupdel:groupdel groupname;
Change user attribute Usermod:usermod-g (GID) attribute user name;
Modify user password passwd:passwd user name;
Switch User Su:su-username; # '-' can be added without
view disk df:df-i/-h/-k/-m; # I:inodes;h: appropriate units; K and M: units representing KB and MB;
View the directory or file space size du:du-a/b/c/k/m/s/h file or directory name; # A: All files and sizes; b: Lists the values as "bytes"; c: Total capacity; K: output in "KB"; M: Output in "KB"; s: only sums are listed ; H: System automatic adjustment unit;
Hard disk partition fdisk:fdisk-l device name;
Format hard disk mke2fs:mke2fs-t/b/m/l;# T type; b block; M size; L label;
Mount disk mount; unmount disk umount;
Ii. Comparison of knowledge points
SUID is only valid for executable binaries, the typical example of the passwd command is to let the user executing this command temporarily execute as the owner of the file.
Sgid can function in the directory can also function in the file, the file must also be an executable binary file, the role is to let the user executing this command temporarily as the file belongs to the identity of the group to execute, and this permission function in the directory, will be implemented, Any user who creates subdirectories or sub-files in this directory is consistent with that directory.
Stick Plain is anti-delete, only useful to the directory, the typical directory is/tmp, because the/tmp directory must be anyone can write, then anyone can delete any files, in order to secure, you have to set this stick permissions, to avoid others to delete my files.
Modification time (Mtime, Modified time): This refers to the time of the file content modification, not the modification of the file attributes, when the data content changes, this time will change, with the command ls-l the default display is this time:
Status Time (CTime): When the state of a file changes, the time changes, such as changing the permissions and attributes of the file, and it changes.
Access Time (Atime): When the contents of the file are read, the time is changed, such as using cat to read/etc/man.config, then the atime of the file will change.
Third, personal experience
This week I learned the Linux explaining section, a total of 29 knowledge points, can not say that all master, but the overall impression is still there. Mainly in this week slowly realized that I learn the method of Linux, the first is to see the meta-class video, while watching to do notes, after reading the paper notes into electronic manuscript, and then do not look at any information on the virtual machine operation again, and then check the notes to review again, weekly summary notes and write them in the blog.
This article from "Senlinux" blog, declined reprint!
"Linux system explaining" Learning Summary (ii)