Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Linux commands commonly used in back-end development

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces the knowledge of "linux commands commonly used in back-end development". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

1. Find a file

Find /-name filename.txt

Look for the "filename.txt" file in the "/" directory by name.

two。 Check whether a program is running

Ps-ef | grep tomcatps-ef | grep java

View all processes related to tomcat/java

3. Terminating thread

Kill-9 19979

Terminate a thread with thread number 19979, where 19979 can be used to view the process number with ps-ef | grep java and so on.

4. View files, including hidden files

Ls-al

5. Current working directory

Pwd

6. Copy a folder including its child files to a custom directory

Cp-r sourceFolder targetFolder

7. Create a directory

Mkdir newfolder

8. Delete directory (this directory is empty)

Rmdir deleteEmptyFolder

9. Delete a folder including its child files

Rm-rf deleteFile

10. Move Fil

Mv / temp/movefile / targetFolder

Extend rename mv oldNameFile newNameFile

11. Switch users

Su-username

twelve。 Modify file permissions

Chmod 777 file.java

Permissions for file.java-rwxrwxrwx,r for read, w for write, x for executable

777 is-111111111

13. Compressed file

Tar-czf test.tar.gz / test1 / test2

14. List the compressed files

Tar-tzf test.tar.gz

15. Extract the file

Tar-xvzf test.tar.gz

16. View the first 10 lines of the file

Head-n 10 example.txt

17. View the last 10 lines of the file

Tail-n 10 example.txt

18. View log files

Tail-f exmaple.log

19. Start the Vi editor

Vi

20. View the system's current time

Datedata + "% Y-%m-%d"

21. Extract the zip file

Unzip-oq

twenty-two。 Check the number of threads (easy to see if the program is wrong)

Ps-Lf port number | wc-l "linux commands commonly used in back-end development". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report