1. Get the IP address
Windows:ipconfig
Linux:ifconfig
2. Go to the folder
cd folder path
3. Restart
Shutdown-r time (when < when to start restarting >)
Reboot immediate Restart
4. View the directory structure
ll query folder
Ll-a View All Files
Ls
Dir
5. View the current path
Pwd
6. Clear the console
Clear
7. Change the password
passwd
8. User Root Path
~
9. Text Editing tools
Vim/etc/frofile Display file
: Q exit
: W Save
: W file name saved as new file
: Wq Save and exit
: q! Forced exit
: Set NU Displays line number
: n jumps to n rows
I enter edit mode
ESC exits edit mode
DD Delete When moving forward
NDD deletes n rows after the current row
YY copy when moving forward
NYY copy n rows starting from the current line
P Paste
G File First line character
NG jumps to the beginning of the nth row
SHIFT+G Relay to last line
Shift+a to end of line and edit
A the next character of the current character is inserted
o Insert a new line and edit
0 jump to the beginning of the line
$ End of line
^ Beginning of the line
x Delete the individual text behind
NX Deletes the next n text
X Delete Previous individual text
NX Delete the previous n text
R replaces the current single text
R replaces the character where the cursor is located until the "esc" key is pressed.
/Find
? Find
N Jump Find results (backward)
N Jump to find results (forward)
Vim + Open File and position on last line
Add the Set NU command at the end of the/ETC/VIMRC file to permanently display line numbers
10. Environment variables
User environment variable file:
~/.bash_profile
System Environment Variables:
/etc/profile
Make environment variables effective
SOURCE ~/.bash_profile
Source/etc/profile
11. Output
Echo $PATH
12. Output to File
echo HelloWorld >/var/www/html/a.txt
13. Get the contents of a file
Cat/var/www/html/a.txt
14. Turn off the machine
Shutdown-h now
Init 0
15. Re-start
Shutdown-r now
Reboot
16. Logout
Logout
Exit
. init command
Init 0 shutdown
Init 3 Text mode
Init 5 Window Mode
18. Create a Folder
mkdir folder name creates only one layer
Mkdir-p folder name to create a directory tree
19. Delete a file or folder
RM file Name
RM-RF recursive forced deletion
20. Copying files or folders
CP file name
Cp-r file name Recursive replication
21. Move/Cut
MV Source Path Destination Path
22. Create
echo Content > file path
Touch file path
Vim file path
23. Current User
WhoAmI
24. Host Name
Hostname
25. Unzip
Tar
TAR-ZXVF Compressed Package Name
Zip:
Unzip compressed package name
rar
Unrar Compressed Package Name
26. Display all content in the file
Cat file name
27. Installing the Software
RPM-IVH Installation
RPM-E sanctions
RPM-QA query is installed
-Yum Installation
Yum List Package Name
Yum remove/erease software Name
Yum Install
29. Service
Service Service Name Start services
Service Service Name Stop services
Service Service name Restart Restart Services
30. Download the file
wget website
31. Querying the running process
Ps-a
32. Query Port Usage
NETSTAT-LNP | grep 80
33. Kill the Process
Kill-9 Process Number
34. Find Files
Find-name file name
35. Start the firewall off
Service Iptables Start
Service Iptables Stop
36. Start-up Operation service
Chkconfig mysqld on
Chkconfig | grep MySQL
37. Save the cache contents
Sync
38. Remote Access
SSH [email protected] Host
39. Modify File Permissions
Chmod-r 777 Path
Shut down firewall: Service iptables stop
Turn on firewall: service iptables start
Installing Mysql:yum Install Mysql-server
Query MySQL Checklist: Yum list mysql*
Immediate effect: Source profile
Boot: Chkcofig mysqld on
Syncing: Sync
Start Mysql:service mysqld Start
Mysql-u User name-p user name
Show databases display all libraries
Use database name to switch databases
Show tables displays all table names in the current database
DESC Table name Display table structure
Linux simple commands