Liunx command work summary
All commands are recorded and used in actual operations. I want to share it with you.
Learning reason:
1. commands can improve the efficiency of liunx system operations.
2. Whether you are using the Linux system or not, I believe that we will only be closer to it and need it in the future.
Because the current company cannot take notes from the company out of the company, only part of the notes can be shared and recorded in the blog.
1. garbled
In actual situations, I often encounter garbled characters when opening text files by VI.
Run the following command in the user's directory:
Setenv Lang. zh_cn.gbk
2. view the Linux version.
Lsb_release-
3. It is common to go to the directory and go out of the directory. Sometimes you need to check the files under multiple directories.
Two commands are useful:
CD-# Back To The Last directory CD~ # Enter the user's directory
4. view the user's shell mode.
Sometimes you need to check whether CSH or bsh is used, which affects the writing and running of shell scripts:
Echo$ Shell
5. View CPU usage of processes
Toptop-D3# Refresh every 3 seconds
6. Grant the file the permission of the current user.
Chmod+ X license.Sh
7. view the logon status of the linked operation Server:
Who# Display all connections to the serverWhoAm I # display logon user informationWhoami# Display current user information
8. Search for files using wildcards
Find./-Name"*. Class"# Search for all class files in the current directory
9. Search for a string in all files.
Find./Log/-name"*"|Xargs Grep "Error"# Locate the./log/file and add all lines with the "error" string in the file
10. query a process with a string (process information, including the process number, can be obtained)
PS-Ef |GrepTomcat
11. Kill the process according to the process number.
Kill-9 1234# Kill the 1234 Process
12. Determine whether the user exists
ID-U Tomcat # determine whether a tomcat user exists
13. Find out who is using this file.
Lsof./tomcat/
14. Force delete an object
Rm-RFFile
15. copy the file
CP-RF/home/Apache-Tomcat-6.0.35/Bin/startup.Sh/Home/CP-RF/home/Apache-Tomcat-6.0.35/Bin/./home/# All files under copy Bin
Continue learning!