Common commands and application scenarios in Linux and Common commands in linux
1. Switch users
Command: su-paytest. Press enter to enter the password.
2. view the File System
Command: df-a (used to view the usage of the file system)
Command: du-shx * (used to list the size of all folders)
3. connect to other servers through SSH
Command: ssh paytest@210.32.22.51, enter the password.
4. send packets using Telnet commands
Command: telnet 210.32.22.51 5010. Press enter and enter the content of the message to be sent.
5. Permanent path alias setting
Command: vi ~ /. Bash_profile
Add: alias log = 'CD/app/applogs'
Command: source ~ /. Bash_profile
6. Related commands for compressed packages:
Tar package compression: tar-cvf filename.tar test1 test2 ......
Decompress the tar package: tar-xvf filename.tar
Tar package browsing: tar-tvf filename.tar
------------------------------------------------------------------
Zip package compression: zip-r/app/filename.zip/app/filename/
Decompress the zip package: unzip filename.zip
7. Check whether the ports under the server are enabled normally.
Command: netstat-lnp | grep 61616 (check whether the ActiveMQ Message Queue Service is started properly)
8. File Transfer between servers
Command: scp filename user @ IP: Path
Example: scp key.txt paytest@210.32.22.51:/app/keytest/
Note: user is the target host user name and IP is the IP address of the target host.
(To be continued ...)