Some useful Linux Command tools

Source: Internet
Author: User
Tags tmp folder ping and traceroute

I just saw a series of blog posts about commands that are rarely used but are very useful at ordinary times. I chose some of the commands that I think should be used to write notes.

Some of these commands are not system commands. You need to download and install them on your own. Debian installation:Sudo apt-get install XXXX. RHEL installation:Yum install XXXX.

1. mtr, with both ping and traceroute commands:

For example, to track the trend of data packets sent to www.baidu.com, a dialog box is displayed on the visual interface:

Mtr www.baidu.com

It can be seen that the displayed data is complete, including the packet loss rate, and the last hop is 115.239.209.10. This address is correct.

2. Ctrl + x + e

When the terminal is enabled, press ctrl + x + e to enter the text mode immediately. Press ctrl + x after you enter the text to play and save it. (All options are displayed ), finally, enter the Save path and file name, which are saved in the/tmp folder by default:

3. ss command:

Ss indicates socket statistics. This command is similar to the netstat command and displays TCP connection information:

4. last command:

The last command displays the user logon and logout history, which is from the/var/log/wtmp file.

5. tree Command:

6. pstree command, process tree:

7. Run the history command to view the command history:

The history command can view the history of input commands. It seems to be saved as a constant string, so only one of the same commands will be saved:

8. Run the stat command to list the details of the file:

This command can detail the information of a file, such as the size, permission, last access time, and last modification time. It is also a practical command.

9. pv command and fun print command:

When hackers knock on the code in a movie, do they feel special? The code is printed slowly, and the pv command can be done. Although it is really useless, it should be installed with apt-get or yum first, then enter the following command to test

Echo "This is just a simple test. The text content is printed one by one on the terminal." | pv-qL 20

10. mount | column-t command combination to display the current mount list:

This command combination can display the list of currently mounted file systems:

11. Press ctrl + l to clear the terminal display content:

We can also use the clear command to clear the terminal display content, but ctrl + l is much more convenient.

12. file command:

The file command also tells you the file encoding method:

13. The id command gets the id information of the user (Group:

This command lists the detailed id information, but does not know how to use this id information for the moment:

14. Run the at command regularly:

This command is similar to the cron command. It executes USER commands at a specified time, for example:

Echo "ls-l>/dev/pts/0" | at or echo "ls-l>/dev/pts/0" | at PM

This means that the detailed information in the folder is written into the/dev/pts/0 file at the specified time. The ">" symbol can be added with the output content to the specified file.

15. du-h -- max-depth = n command:

This command outputs the size of the sub-folder under the current directory (n specifies the maximum number of recursion layers) to the terminal in a unit, such as (comparing ls-l ):

16. Run the look command to blur the spelling of English words:

If you are not sure whether the English words you entered are in this fight, Baidu and google can be the most direct. Of course, the Linux system comes with a fuzzy check tool, for example, I want to spell difficult, but I don't know, right? If you enter look diffi in a fuzzy way, it will give you the answer:

17. factor command, factorization:

18. The tac command outputs the file content in reverse order:

Very talented, cat is the tac. After the command is completed, the text content is output in reverse order:

19. Run the disown-a & exit command to run the process in the background:

Generally, we open a terminal to execute a command. If the terminal is closed, the process will end. However, if the disown-a & exit command is used, the process can be closed after the terminal is closed, it can still be run in the background in the format:

 
20. convert command. The output terminal result is of the specified file type:

For example, I want to output the structure tree of the specified folder as a png Image:

 

The question mark is a Chinese character and cannot be identified or garbled.

21. Run the host and dig commands to find the available IP addresses of the specified host:

For example, to find the IP address of Google DNS, run the host command:

The dig command is more detailed:

22. dstat, system resource monitoring:

This command dynamically updates and displays system information. You can use the corresponding process ID to determine the resource usage:

23. Run the nc-zv command to check whether the port is Enabled:

Command usage:

Nc-zv host name or address port number

For example, I want to know the port 80 of www.baidu.com:

Change the local port to localhost or 127.0.0.1.

24. Run the pdftk command to merge multiple pdf files:

Command usage:

 
25. The ps-LF-u user_name command displays the process information executed by the specified user:

 

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.