Linux Command Line

Source: Internet
Author: User

I. lsof

for all files of Linux,list open FIles is undoubtedly very useful, the common parameters mark, for follow-up quick query.

1.-I.

Internet, which is network-related, usage:

LSOF-I[46] [protocol][@hostname |hostaddr][:service|port]

---IPV4 or IPV6

Protocol---TCP or UDP

Hostname-Internet Host name

HOSTADDR-IPV4 Address

Service name in service---/etc/service (can be more than one)

Port-and port number (can be more than one)

Cases:

lsof-i Show All Connections

lsof [email protected]:513-515 Show TCP connection to 10.143.0.10 513-515 Port

Note that UDP is not connected, so it is not possible to display UDP connections to other servers through this command.

2. Direct access to file name without parameters

See which processes the file is being opened by

lsof Abc.txt

3.-C

command, commands, corresponding process names, lists the files opened by the process, usage:

lsof-c nginx show Nginx process now open file

4.-A

The and,lsof parameter is a relationship between or, which modifies or is modified to and.

5.-S [p:s]

Direct-S can also be used to display the size of file, but the most commonly used is to connect the [p:s] option, p means that protocol,s represents state, at the same time be sure to take the-I option: "If only TCP and UDP files is To is listed, as controlled by the specified exclusions and inclusions, the-i option must be specified, too ".

lsof-s tcp:established-i TCP


Two. traceroute

There is nothing to say about this command, which detects each Router in the path by incrementing the TTL field in the IP header.

The default detection protocol is UDP, the destination port is greater than 30000, because there is basically no application to open the port in this range.

-I: Using the ICMP protocol

-T: Using the TCP protocol

-P: Specify Destination port

-M: Specifies the maximum TTL, which defaults to 30

-N: Specifies the total concurrent number of probe packets

-Q: Specifies the concurrent number of probe packets for a route

Manual claims that it can be used to detect path MTU, but only the MTU of the first one is actually displayed.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/5C/24/wKioL1Ubqliij54nAAFfcehO428364.jpg "title=" 1.jpg " alt= "Wkiol1ubqliij54naaffceho428364.jpg"/>


Three. Tracepath

The difference between this command and Traceroute is that the full path MTU and symmetric/asymmetric information can be displayed.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/5C/24/wKioL1UbrKiD_5sgAAHYPAqUy4Y604.jpg "title=" 2.jpg " alt= "Wkiol1ubrkid_5sgaahypaquy4y604.jpg"/>



Four. mtr

In contrast, this command is relatively small and is not installed by default in Fedora 17.

Its main role is equivalent to the above 2 commands, but also integrates a portion of the ping function, you can output network quality status, the average means network quality, variance represents network jitter.

-r:report mode

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/5C/2B/wKiom1Ubtnaj9BmoAAIfE3lJ63s570.jpg "title=" 3.jpg " alt= "Wkiom1ubtnaj9bmoaaife3lj63s570.jpg"/>


Five. SS


Six. IP


Seven. Netstat


Eight. Nmap


Nine. Strace


10. Ltrace


This article from "Wilber" blog, declined reprint!

Linux Command Line

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.