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

What are the 20 commands commonly used in linux

2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article is about what the 20 commands commonly used in linux are. The editor thought it was very practical, so I shared it with you as a reference. Let's follow the editor and have a look.

Common commands in Linux include finding, copying, terminating threads, creating directories, deleting directories, moving files, switching users, and so on.

There are many common commands in Linux that must be mastered, and knowing these commands can help us solve problems better and faster. Next, I will share with you the 20 most commonly used commands in the linux system, which have a certain reference value. I hope it will be helpful to you.

1. Find looks for files or directories

Find /-size + 204800k / / find files larger than 200MB in the root directory

Find /-user username// looks for files owned by username in the root directory

Find /-name filename.txt / / look up the filename.txt file in the / directory by name.

2. Copy the file, including its child files, to the custom directory

Cp-r sourceFolder targetFolder

3. Check whether a program is running

Ps-ef | grep tomcat / / View all processes related to tomcat

4. Terminate the thread

Kill-9 19979 / / terminates a thread with thread number 19979

5. View files, including hidden files

Ls-al

6. Current working directory

Pwd

7. Create a directory

Mkdir newfolder

8. Delete directory (this directory is empty)

Rmdir deleteEmptyFolder

9. Delete a file including its child files

Rm-rf deleteFile

10. Move Fil

The mv / temp/movefile / targetFolder// extension renames mv oldNameFile newNameFile

11. Switch users

Su-username

twelve。 Modify file permissions

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

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 / / this command automatically displays the new content, and the screen displays only 10 lines of content (configurable).

19. Start the Vi editor

Vi

20. View the system's current time

Date

The command will output what day of the week, what day, time and time display format and year

Sat Feb 22 15:36:49 CST 2019

Date + "% Y-%m-%d"

The display is as follows:

[root@ming xxx] # date + "% Y-%m-%d"

2019-02-22

Thank you for reading! About what the 20 commands commonly used in linux are shared here, I hope the above content can be helpful to you, so that you can learn more knowledge. If you think the article is good, you can share it and let more people see it.

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

Servers

Wechat

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

12
Report