In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Today, I will talk to you about the basic network commands of the Linux system, which may not be well understood by many people. in order to make you understand better, the editor has summarized the following contents for you. I hope you can get something according to this article.
1. There is no option for hostnamehostname 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
Add: in fact, using the "hostname+ new hostname" command can also temporarily set the hostname, such as hostname newname
The advantage of this is that the host name can be temporarily modified without rebooting. Changing the hostname through the / etc/sysconfig/network file requires a restart to take effect. Of course, after executing this command, we must remember to manually modify the value of HOSTNAME in the / etc/sysconfig/network file in order for subsequent restarts to take effect. This is a trick!
2. 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 zhangge.net it will return its ip address. You can stop the command through ctrl+C.
Add: the-c parameter can define the number of ping, and the network judgment in the script is often used, for example, ping-c 4 zhangge.net is ping Zhang GE blog four times, while under windows, the-n parameter is used to define the number of ping, such as ping-n 4 zhangge.net
3. 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.
Add: Windows uses ipconfig, that is to say, bloggers have used Linux for a long time, go back to windows and often enter ifconfig o (╯□╰) o next time.
4. 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.
5. Nslookupnslookup this command when you have an ip address, you can use this command to display the hostname and find all the ip addresses of a given domain name. And you have to connect to the Internet to use this command.
An example. Nslookup marsge.cn
You can also use nslookup to get the hostname from ip or ip from the hostname.
Add: this command also applies under Windows.
6. 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.
Add: there is a similar command under windows. Children's shoes that like to play the Windows command can try:
MS DOS
How to use 12345678910111213141516tracert: tracert [- d] [- h maximum_hops] [- j host-list] [- w timeout] [- R] [- S srcaddr] [- 4] [- 6] target_name option:-d do not resolve the address to the host name. -h maximum_hops the maximum number of hops used to search for the target. -j host-list loose list of hosts source routes (IPv4 only). -w timeout the waiting time for each reply (in milliseconds). -R tracks the back-and-forth path (IPv6 only). -the source address to be used by S srcaddr (IPv6 only). -4 enforce the use of IPv4. -6 mandatory use of IPv6. For example: tracert zhangge.net
7. 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.
Add: you can also view user information with the who-a command.
8. Telnet connects to the target host through the telnet protocol. 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.
Add: this command also applies under Windows.
9. Ethtoolethtool allows you to view and change many settings of the network card (excluding 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
10. 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.
After reading the above, do you have any further understanding of the basic network commands of the Linux system? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.