1. Change the name of the machine:
Vim/etc/hostname
Master
Modify the machine name in the file for the name we want (equivalent to the domain name)
Can be closed by shutdown-h now
2. View current machine IP:
Ifconfig
3.vim/etc/hosts
127.0.0.1 localhost
establish the mapping between the IP and the domain name , access to the domain name directly, if you want to access the remote machine, you must configure the remote machine's domain name and IP address mapping in the current machine/etc/hosts file , So when we access the remote domain name, we will resolve the/etc/hosts to locate the remote machine's IP address, thus accessing the remote machine.
4.vim cat gedit Viewing files
The file needs a page view, you can use the more command, press ENTER to page
Tail viewing the final contents of a file
5. Create a file Touch spark.txt
6.mkdir a Create a level directory, Mkdir-p a/b/c create a multilevel directory at once
7.rmdir Delete directory, RM-RF Force delete all contents in current file (clip)
8.TAR-CZVF xxx.gz a.txt Compressed file tar-zxvf xxx.gz
9.man < operation name > can be viewed using
10. File Permissions
The 1th column: "-" represents the file; "D" represents the directory; "L" Shortcut
2nd to 4th Column: Represents the current user's specific operation permissions for the file
1) Readable R 2^2=4
2) Writable W 2^1=2
3) executable x 2^0=1
5th to 7th column: Represents the user group of the current user for the file (folder) operation permissions
Column 8th to 10th: Action permissions on the file (folder) on behalf of users other than the current user group
11th column: Number of connections representing the current file
12th column: The user owner who represents the current file
13th column: Represents the user group where the current user resides
14th column: Representing file size
15th column: Represents the time the file was created or modified
11. User and user groups to modify files
Create User: Useradd Work1
Owner of the settings file: Chown work1 a.txt
Change the user group to which the current file belongs: Chgrp work A.txt
12. Modify File Permissions
chmod 764 a.txt Results:-rwxrw-r--
chmod 744 a.txt Results:-rwxr--r--
13.SHH Remote login without password
sudo apt-get install SSH download installation SSH service;
sudo apt-get install rsync installation automatic synchronization service;
Linux most commonly used command combat