Check whether a port of the firewall is open
firewall-cmd --query-port=3306/tcp
Open firewall port 3306
firewall-cmd --zone=public --add-port=3306/tcp --permanent
View firewall status
systemctl status firewalld
Turn off the firewall
systemctl stop firewalld
Open firewall
systemctl start firewalld
Open a port
firewall-cmd --zone=public --add-port=40000-45000/tcp --permanent
Don’t forget to execute it immediately after setting
firewall-cmd --reload
View all open ports under the firewall
firewall-cmd --zone=public --list-ports
View the current path: pwd
Unzip: tar -xvf file name
Move: the path where the mv file name is moved
Rename: mv old file name new file name
Enter the directory: cd path
View file: ls
Create a blank file: touch file name
Create directory: mkdir directory name
Delete directory: rmdir
Delete the directory and all the following files: rm -rf directory name
Delete file rm file name
Delete the file without prompting: rm -f file name
Copy file: cp file name
View the specified port: netstat -ntlp|grep port
View the specified software: ps -ef|grep software name
/bin Run script that all users can use
/sbin Run script that can only be used by root user
/lib binary package
/lib64 64bit binary package
/dev device management file
/home Home directory of ordinary users
/mnt is used to mount external devices
/var Some directories that are often modified to increase data
/usr is generally used to install applications
/boot linux system boot related directory
/etc configuration file
/media multimedia directory
/root root super administrator's home directory
In centos7, the system has its own vim editor, if you cannot use it, you can use the installation command to install
yum -y install vim
Normal mode: open the file for the first time, or press the esc key in other modes to enter the normal mode
Edit mode: Press i, a, o in normal mode to enter edit mode, press esc to exit edit mode and enter normal mode
Command line mode: press ":" in normal mode to enter command line mode
Normal mode is equivalent to a bridge to switch to the other two modes
Copy a row of data: yy
Copy n rows of data: n yy
Paste the copied content: p
Quickly switch to the first line: gg
Quickly switch to the nth line: n gg
Quickly switch to the end of the line: G
Delete the line where the cursor is: dd
Delete n lines from the cursor: ndd
Turn on the line number display: :set nu
Leave vim temporarily::shell
Return to vim from exit mode: exit
Save::w
Exit: :q
Force exit: :q! (If you do not make changes to the file, you need to force exit)
Save and exit: :wq
Recommended Posts