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 commonly used network commands and their usage under Linux

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

Share

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

What are the commonly used network commands under Linux and how to use them? in order to solve this problem, this article introduces the corresponding analysis and solutions in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.

Common Network commands and their usage under Linux

Hostnamehostname has no option to display the host name

Hostname-d shows the domain name to which the machine belongs

Hostname-f displays the full hostname and domain name

Hostname-I displays the ip address of the current machine

Pingping sends the packet to the user to specify the address. When the packet is received, the target machine sends a return packet. Ping has two main functions:

Used to confirm that the network connection is open.

Used to view the speed information of the connection.

If you ping www.yahoo.com it will return its ip address. You can stop the command through ctrl+C.

Ifconfig views the user's network configuration. It displays the current network device configuration. This tool is extremely useful for error lookups that need to receive or send data.

The iwconfigiwconfig tool is similar to ifconfig and ethtool. It is used for wireless network card. You can use it to view and set up basic Wi-Fi network information, such as SSID, channel and encryption. There are many other configurations that you can also view and modify, including reception sensitivity, RTS/CTS, the fragment size of the sent packet, and the retransmission mechanism of the wireless network card.

When the nslookupnslookup command has an ip address, you can use this command to display the hostname and find all ip addresses for a given domain name. And you have to connect to the Internet to use this command.

An example. Nslookup blogger.com

You can also use nslookup to get the hostname from ip or ip from the hostname.

Traceroute is a convenient tool. It can be used to view the IP address, hop count, and response time of the router that the packet passes through when it is submitted to a remote system or website. Similarly, you must link to the Internet to use this command.

Finger views user information. Displays the user's login name, real name, as well as the login terminal name and login permissions. This is a very old command from unix and is seldom used now.

Telnet connects to the target host through the telnet protocol, and if the telnet connection can be completed on any port, it means that the connection between the two hosts is good.

Telnet hostname port-uses the specified port telnet hostname. This is usually used to test whether the host is online or whether the network is normal.

Ethtoolethtool allows you to view and change many settings of the network card (not including the Wi-Fi network card). You can manage many advanced settings, including tx/rx, validation, and Wake up. Here are some basic commands that might interest you:

Ethtool-I displays driver information for a specific network card, which is especially useful when checking software compatibility

Ethtool-p initiates the specified behavior of an adapter, such as flashing the adapter's LED light, to help you identify interface names in multiple adapters or interfaces

Ethtool-s displays network statistics

Ethtool speed sets the connection speed of the adapter in Mbps

Netstat found that host connections are the most useful and general-purpose Linux commands. You can use "netstat-g" to query all multicast groups (networks) subscribed to by this host.

Netstat-nap | grep port will display the process id of the application using this port

Netstat-an or netstat-all will display all connections including TCP and UDP

Netstat tcp or netstat-t will display the TCP connection

Netstat udp or netstat-u will display the UDP connection

Netstat-g will show all multicast networks that the host subscribes to.

The answers to the questions about the commonly used network commands and their usage under Linux are shared here. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.

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

Development

Wechat

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

12
Report