"Summary of Linux Commands"-Continuous additions and updates to subsequent use

Source: Internet
Author: User

For example: A file is a go file named Hello.go.

1, run a program in the background, output the results to a file,

If you are running the GO program directly: Go Run hello.go

Run in the background: Nohup go run hello.go & then output the results to Nohup.out

2. View log information for real-time updates

View the contents of a file, such as a non-real-time one, and do not modify it: Cat Hello.go

View real-time information: Tail-f nohup.out (Note: The file here is a nohup.out file)

3. Find the port number and kill the process (the better article written here: http://icymarywei.blog.163.com/blog/static/127508102201122085513414/)

First find the port number and find the corresponding process:

grep is used for filtering, such as the port number is 9090, using NETSTAT-NLP | grep:9090

After this value is obtained, the PID value is 17474, followed by the command: kill-9 PID number, where 9 represents the meaning: (-9 is the signal volume)

See if a program's process exists, such as:

Then you can get all the current process that contains the word go, and then the column behind root is the PID of the process, and the kill-9 PID is used to kill the process.

About the semaphore, here is an article about: http://www.jianshu.com/p/966d18eac17e, which has a picture of the detailed description:

KTLL 11 1) 51 stone Hupz) si6int3) si6quit4) si6ills) Si6trap 6) 51 stone ABRT7) Si6buss) sigfpeg) SIGKILL10) Si6usri) si6se6v12) SI6USRZ13) si6pipe14) si6alrm15) si6terh) si6stkflt17) si6chld18) si6co) SIGSTOP20) SI6TSTP 21) 51 stone tl-in22) Si6ttou23) 51 stone UR624) si6xcpu25) Si6xfsz 26) 51 Stone stare Al Yin) si6prof28) 51 INCH29) SIGIO30) si6p) si6sys34) si6r magazine IN35) si6r in+136) si6r in+237) si6rtmin+3 (si6rtmin) si6r) in+5) sigrtmin+641) si6rtmin+742 rain I called 43) 516 stare si6r) 51 Stone R in+1045) si6r journal in+1146) si6rtmin+1247) Sigrt 48) 51 stone rtmin+1449) 51 stone rtmin+1550) Sigrtmax 11,451) si6r magazine x 11,352) si6r 53) SI6RT Eye x 11,154) 51 Stone R nuclear x 11,055) Si6rtmax 1956) Si6rtmax 1857) 51 stone R side) Si6rtmax 1659) si6rt skim x 15 imprint) Sigrtmax 1461) Sigrt eye x 1362) SI6RTM City 63) 51. Stare at. X 1164) s work. R, X, Yi bu "v:shapes=" picture _x0020_1 ">

Here's an article: Https://linux.cn/article-2973-1.html, about Kill's command.

4. Find the process of a program and kill the process

Should be able to use: Ps-aux | grep process name, such as: Ps-aux | grep java

Or: Ps-ef | grep process name, such as Ps-aux | grep python

Need to check the difference between aux and EF

5. Vim Base operation

Through the vim file name into the Vim editor, and then click I or I enter the editing state, and then modify, after the change, the ESC key to exit the edit state, and then automatically jump to the bottom part, enter: W means to save, after: Q to exit the Vim editor, or you can: Wq, You can also use: q! to indicate forced exit

6. Modify the name of the folder or file

The command MV for renaming files or folders under Linux can be renamed, and files or folders can be moved.

Example: Renaming directory A to B

MV A B

Example: Move the/a directory to/b and rename to C

mv/a/b/c

"Summary of Linux Commands"-Continuous additions and updates to subsequent use

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.