MV: Moving commands and modifying file and directory names moving files and directories example: Move the lists file in the current directory to its subdirectory babydog command: MV lists Babydog Renaming files and directories: Change the BigDog directory name to babydog command: MV BigDog babydogcat: View file Contents command Browse through the full contents of the Game.txt file: Cat game.txthead: View the commands at the beginning View/etc/ passwd the first 10 lines of the file in the details command:head/etc/passwd View the/etc/passwd file for more information in the first 5 lines of the command :head–n 5/etc/pas Swdtail: View tail command View more information about the last 10 lines in the/etc/passwd file command: Tail/etc/pas swd View/ETC/PASSW &NBS P D file for more information on the last 5 lines of the command: Tail–n 5/etc/passwdtail-f Scroll to see what's new in the file is often used to view the log error more: View content in percent less: content can be displayed up and down > You can write the left side to the right (overlay) >> Subsequent additions echo ' content ' > Text useradd user1 #创建的文件/etc/passwd: Store user Information/etc/ Shadow: Store user's password/etc/group : storage group Information/etc/gshadow: Store group password/home/user1: User home directory/var/spool/mail/user1: User's mailbox Mastering the function of the Useradd command: Add a new user. Learn about common options for the Useradd command: a) –u: Specify the user's Uidb) –g: Specify the user's Group C) –d: Specify the user's home directory d) –c: Specify user's note information e) –s: Specify the user's shell for flexible application of the Useradd command example: a) For example: Add a fox (FOX) User command to the system: Useradd FOXB) For example: Add a user User01 to the system, a command with a group of police and a UID of 600: useradd–u 600–g Police User01 Use the Usermod command to modify the user account (see Linux System Management P458) to master the function of the USERMOD command: Modify the user's account information. Learn about the common options for the Usermod command: a) –u: Modify the user's Uidb) –g: Modify the user's GIDC) –g: Add a user to the specified Group D) –d: Modify the user's home directory e) –c: Modify the user's comment information f) –s: Modify the user's Shell3) Example of flexible application of the USERMOD command: a) modify BABYDOG4 user's home directory for/home/babies command: Usermod–d/home/babies babydog4b) Add Babydog4 This user to Babydog6 command in this group: usermod–g babydog6 babydog4c) Change the GID of this user to the Dog Group command: Babydog4 Dog Babydog4 Use the Usermod command to lock the user and unlock the user (see Linux systemManagement P461) 1) Understand the function of Usermod–l: Lock the user's account 2) for an example of the usage of the Usermod–l order: for example: The command to lock the user's account Babydog6: Usermod–l babydog63) Learn about usermod– U-order function: Unlock user's account 4) Learn about the usage examples of usermod–u: for example: the command to unlock Babydog6 user's account: Usermod–u Babydog6 Use the Userdel command to delete the user account (see Linux System Management P462) 1) Mastering the function of the Userdel command: delete the user. 2) Learn about the common options for the Userdel command: a) –r: Delete the user's home directory and its mailbox while deleting the user. 3) Flexible Application Userdel command to delete the user's example: a) For example: Delete babydog5 users do not delete their home directory command: Userdel babydog5b) For example: Delete babydog5 users, while deleting their home directory command: Userdel–r Babydog5userdel-r to completely remove user information Groupmod commands common options: –g: Modify group Gid –n: Modify the name of the group Examples of flexible application of GROUPMOD commands: For example: Modify the police group's GID to 521 command: Groupmod–g 521 police For example: The command to rename a group boydogs to Daddogs: groupmod– N daddogs boydogs Mastering the function of the Groupdel command: Delete a group account. Examples of flexible application of GROUPDEL commands: For example: delete daddogs Group command: Groupdel daddogs vim: Edit file Vim file path (yype copy paste previous line before a) a-----> Enter edit mode, then go up and down to find the changes to modify and then click ESC shift+: input Wq save exit Use the new method to establish a user account needs to/etc/ Copy of hidden information in Skel directory to new/home/user name new/home/user name and/var/spool/mail in new state/user name belongs to root need to change owner, genus: Chown-r: Genus Group/home/username chown owner: mail/var/spool/mail/username ID Life Enable to view the user's status id username UID: main gid: Main group & nbsp Group: Sub-group Useradd user1-u 1003-g 0-c "test user,,," -d/home/aaa -s/sbin/nologinusermod user1-a-G group2 will User1 Append to group2 group Safe Mode Setenforce 0 GETENFORCELS-LH is equivalent to ll-h viewing the file size in a simple way ls-dl viewing the details of the directory itself is equivalent to ll-d file and folder permissions set R : 4 w:2 x:1 -: Read modify Execute &nbs P No modify permission can be used chmod u (Master) = (or +,-), g (genus) = (or +,-), O (Others) = (or +,-) modify file permissions can also be modified with chmod 777 file name Permissions Chmod-r recursively modify the permissions of the directory under the file: R: Can read the contents of the file W: can modify the contents of the file X: can be the file when the program to execute the directory: R: You can browse to the directory of subdirectories and sub-file name W: You can then create new files in this directory, delete files, rename files x: You can use the CD command to enter the directory
Five day Linux Basic learning