(1) Write
The Write command is used to send messages to the specified user, Ctrl+d save ends, and the path is/usr/bin/write, in the syntax format:
Write [user name]
Note: Can only be sent to online users.
Example: New WS user, root remote sends hello information to WS remote end.
Root side:
[[email protected] cdrom]# write Wshello
WS-Side:
[[Email protected] ~] $Message from [e-mail protected] on PTS/1 at 03:58 ... helloeof
Where EOF indicates the end.
(2) Wall
The wall command is used to send broadcast messages, the English original is write all, where the path is/usr/bin/wall, and its syntax is:
Wall [message]
Example: Send a hello message to all online users at the root remote end:
Root side:
[[email protected] cdrom]# Wall Hello[[email protected] cdrom] #Broadcast message from [email protected] (PTS/1) (Fri jan
2 04:05:08): Hello
WS-Side:
[[Email protected] ~] $Broadcast message from [email protected] (PTS/1) (Fri Jan 2 04:05:08): Hello
(3) Ping
The ping command is used to test network connectivity, where the path is/bin/ping, in the syntax format:
Ping option IP Address
Where-c option specifies the number of times to send
For example: Test the loopback address 127.0.0.1, set the number of times to 3:
[Email protected] cdrom]# ping-c 3 127.0.0.1PING 127.0.0.1 (127.0.0.1) (+) bytes of data.64 bytes from 127.0.0.1:ICM P_seq=1 ttl=64 time=0.274 ms64 bytes from 127.0.0.1:icmp_seq=2 ttl=64 time=0.072 ms64 bytes from 127.0.0.1:icmp_seq=3 tt l=64 time=0.070 ms---127.0.0.1 PING statistics---3 packets transmitted, 3 received, 0% packet loss, time 1999msrtt min/ Avg/max/mdev = 0.070/0.138/0.274/0.096 ms
(4) Ifconfig
The Ifconfig command is used to view and set the network card information, the English original intent is interface configure, where the path is/sbin/ifconfig, the syntax format is:
Ifconfig Network card IP address
Note: Ifconfig only temporarily sets the IP address, and the configuration is eliminated the next time the system is restarted.
(5) Mail
The Mail command is used to view and send e-mail messages, characterized by the user not being able to send them online, where the path is/bin/mail, with the syntax in the following format:
Mail [user name]
Example: Root remote end sending mail to WS remote
Root Remote side:
[[Email protected] cdrom]# mail Wssubject:hellohello I am wseot[[email protected] cdrom]#
WS Remote End:
[Email protected] ~]$ mailheirloom Mail version 12.4 7/29/08. Type? For help. " /var/spool/mail/ws ": 1 message 1 new>n 1 root Fri Jan 2 04:17 18/606 " Hello "&
Enter 1 to view the message:
& 1Message 1:from [email protected] Fri Jan 2 04:17:44 2015return-path: <[email protected]> x-original-to:wsdelivered-to: [Email Protected]date:fri, 04:17:43 +0800to: [Email protected]subject:hellous Er-agent:heirloom MAILX 12.4 7/29/08content-type:text/plain; Charset=us-asciifrom: [Email protected] (root) status:r hello i am ws &
(6) Last
The last command lists user information that is currently logged into the system, with a path of/usr/bin/last, in the syntax format:
Last
Cases:
[[email protected] cdrom]# lastws pts/0 110.13.4.109 Fri Jan 2 03:57 still logged in WS pts/ 0 110.13.4.109 Fri Jan 2 03:56-03:57 (00:00) ws pts/0 110.13.4.109 Thu Jan 1 22:59-00: 01:03 root PTS/1 110.13.4.109 Thu Jan 1 18:44 still logged in root pts/0 110.13.4.109 Thu Jan 1 18:38-20:49 (02:11) root tty1 Thu Jan 1 18:36 still logged in reboot System Boot 2.6.32-431.el6.i Thu Jan 1 18:35-04:22 (09:47) root pts/0 110.13.4.109 Thu Jan 1 17: 43-crash (00:51) root tty1 Thu Jan 1 17:41-crash (00:54) reboot system boot 2.6. 32-431.el6.i Thu Jan 1 17:38-04:22 (10:43) root pts/0 110.13.4.236 Tue Oct 20:24-crash (71+21:1 3) Root tty1 Tue Oct 20:23-crash (71+21:15) reboot system boot 2.6.32-431.el6.i Tue Oct 21 18:59-04:22 (72+09: Root pts/0 110.13.4.236 Tue Oct 06:31-06:32 (00:00) root tty1 Tue Oct 06:29-crash (12:30pm) reboot system boot 2.6.32-431.el6.i Tue Oct 06:27-04:22 (72+21:54) wtmp begins T UE OCT 21 06:27:29 2014
(7) Lastlog
The Lastlog command is used to check the last logon time for a particular user, where the path is/usr/bin/lastlog, with the syntax in the following format:
Lastlog
Example: Lastlog or Last-u 500
[Email protected] cdrom]# lastlog-u 500Username Port from latestws pts/0 110.13.4.109 Fri Jan 2 03:57:07 +0800 2015
(8) Traceroute
The traceroute command is used to display the path information between packets to the host, where the path is/bin/traceroute, with the syntax in the following format:
Traceroute website
(9) Netstat
The netstat command is used to display network-related information, where the path is/bin/netstat, with the syntax in the following format:
netstat [options]
Where the-t option represents the TCP protocol, the-U option represents the UDP protocol,-L for listening,-R for routing, and-n for displaying the IP address and port number.
such as: View the local listening port-----Netstat-tlun
View all network connections on this computer-----netstat-an
View the native routing table-----Netstat-rn.
(Ten) Setup
The Setup command is used to configure the network, which is characterized by a permanent effect, unlike ifconfig, where the path is/usr/bin/setup and its syntax is in the following format:
Setup
Note: This command is a proprietary command of the Red Hat series.
(one) Mount
The Mount command is used for mounting, where the path is/bin/mount, with the syntax in the following format:
Mount [-t file system] device file name mount point
Example: Create a CDROM folder as a mount point in the/mnt directory, then select an ISO image and mount it:
[Email protected] ~]# mkdir/mnt/cdrom[[email protected] ~]# Mount/dev/sr0/mnt/cdrom/mount:block device/dev/sr0 is WR ite-protected, mounting read-only[[email protected] ~]# ls/mnt/cdrom/autorun.inf Casper EFI Isolinux pics preseed ubuntuboot dists install md5sum.txt pool readme.diskdefines Wubi.exe[[email protected] ~]# umount/dev/sr0
Linux Learning Notes (8) network commands for common Linux commands