Linux Study Notes-network related Ping finger NSLookup netstat [Post]

Source: Internet
Author: User

 

Netstat command

The netstat command displays network connection, route table, and network interface information, allowing you to know which network connections are currently in operation.

The common format of this command is:

Netstat [Option]

The meanings of the options in the command are as follows:

-A displays all sockets, including those being monitored.

-C is re-displayed every one second until the user interrupts it.

-I displays information of all network interfaces in the same format as "ifconfig-e ".

-N is replaced by a network IP address to show network connection conditions.

-R displays the core route table in the same format as "route-e ".

-T shows the TCP connection status.

-U: displays the connections of the UDP protocol.

-V: displays ongoing work.

[Example] Run the netstat command on a local machine.

$ Netstat

Active Internet connections (W/O servers)

PROTO Recv-Q send-Q local address foreign address State

Active Unix domain sockets (W/O servers)

PROTO refcnt flags type state I-Node path

UNIX 1 [] stream connected 270 @ 00000008

UNIX 1 [] stream connected 150 @ 00000002

UNIX 1 [] stream connected 104 @ 00000001

UNIX 1 [] stream connected 222 @ 00000004

UNIX 1 [] stream connected 171 @ 00000003

UNIX 1 [] stream connected 271/dev/log

UNIX 1 [] stream connected 225/dev/log

UNIX 1 [] stream connected 223/dev/log

UNIX 1 [] stream connected 203/dev/log

UNIX 1 [] stream connected 105/dev/log

......

NSLookup command

The NSLookup command is used to query the IP address of a machine and its corresponding domain name. It usually requires a Domain Name Server to provide domain name services. If you have configured a Domain Name Server, you can use this command to view the domain name corresponding to the IP addresses of different hosts.

The common format of this command is:

NSLookup [IP Address/domain name]

[Example] Run the NSLookup command on the local machine.

$ NSLookup

Default Server: name.tlc.com.cn

Address: 192.168.1.99

>

Enter the IP address or domain name to be queried after the symbol ">" and press Enter. To exit the command, enter exit and press Enter.

Finger command

The finger command is used to query user information. It usually displays the user name, main directory, stagnation time, Logon Time, logon shell, and other information of a user in the system. To query user information on a remote machine, you need to connect the user name to "@ host name" in the format of [user name @ host name]. However, the network host to be queried must run the finger daemon.

The common format of this command is:

Finger [Option] [user] [user @ host]

The meanings of the options in the command are as follows:

-S displays the user's registration name, actual name, terminal name, write status, stagnation time, Logon Time, and other information.

-L in addition to the information displayed with the-s option, it also displays information such as the user's home directory, logon shell, email status, and under the user's home directory. plan ,. project and. the content of the forward file.

-P is the same as the-L option except that the. Plan and. project files are not displayed.

 

[Example] Run the finger command on the local machine.

$ Finger xxq

Login: xxq Name:

Directory:/home/xxq shell:/bin/bash

Last login Thu Jan 1 21:43 (CST) on tty1

No mail.

No plan.

 

$ Finger

Login Name TTY Idle login time office phone

Root * 1 28 Nov 25

......

Ping Command

The ping command is used to check whether the host on the network is working. It sends an ICMP echo_request packet to the host. Sometimes we want to download files from a host on the network, but do not know whether the host is on, we need to use the ping command to check.

The common format of this command is:

Ping [Option] Host Name/IP Address

The meanings of the options in the command are as follows:

-The number of C stops when a specified number of packages are sent.

-D: Set the so_debug option.

-F sends a large number of network packets to a machine quickly to view its response.

-I: sets the interval of seconds to send a network packet to a machine. The default value is to send a packet once a second.

-L the number of packets is the fastest to send to the specified machine within the specified number of times (this option can only be used by Super Users ).

-Q: only the final result is displayed.

-R Directly sends packets to a machine without passing through the gateway. It usually checks whether the network interface of the local machine is faulty.

-S bytes indicates the number of data bytes to be sent. The default value is 56, plus an 8-byte ICMP header, which is a total of 64 ICMP data bytes.

 

 

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.