Linux中20个高级命令( 二 )

如果你不想将主机、端口和用户名解析为 netstat 的输出 。
[rumenz@local ~]$ netstat -an
你可能需要不断获取 netstat 的输出,直到通过中断指令(ctrl+c) 。
[rumenz@local ~]$ netstat -c43. nslookup命令
一种网络实用程序,用于获取有关 Internet 服务器的信息 。顾名思义,该实用程序通过查询来查找域的名称服务器信息DNS.
[rumenz@local ~]$ nslookup rumenz.com Server:192.168.1.1 Address: 192.168.1.1#53 Non-authoritative answer: Name: rumenz.com Address: 50.16.67.239查询邮件交换记录[rumenz@local ~]$ nslookup -query=mx rumenz.com Server:192.168.1.1 Address: 192.168.1.1#53 Non-authoritative answer: rumenz.com mail exchanger = 0 smtp.secureserver.net. rumenz.com mail exchanger = 10 mailstore1.secureserver.net. Authoritative answers can be found from:查询名称服务器[rumenz@local ~]$ nslookup -type=ns rumenz.com Server:192.168.1.1 Address: 192.168.1.1#53 Non-authoritative answer: rumenz.com nameserver = ns3404.com. rumenz.com nameserver = ns3403.com. Authoritative answers can be found from:查询 DNS 记录[rumenz@local ~]$ nslookup -type=any rumenz.com Server:192.168.1.1 Address: 192.168.1.1#53 Non-authoritative answer: rumenz.com mail exchanger = 10 mailstore1.secureserver.net. rumenz.com mail exchanger = 0 smtp.secureserver.net. rumenz.com nameserver = ns06.domaincontrol.com. rumenz.com nameserver = ns3404.com. rumenz.com nameserver = ns3403.com. rumenz.com nameserver = ns05.domaincontrol.com. Authoritative answers can be found from:查询权限开始[rumenz@local ~]$ nslookup -type=soa rumenz.com Server:192.168.1.1 Address: 192.168.1.1#53 Non-authoritative answer: rumenz.comorigin = ns3403.hostgator.commail addr = dnsadmin.gator1702.hostgator.comserial = 2012081102refresh = 86400retry = 7200expire = 3600000minimum = 86400 Authoritative answers can be found from:查询端口号
更改要连接的端口号
[rumenz@local ~]$ nslookup -port 56 rumenz.comServer:rumenz.comAddress: 50.16.76.239#53Name: 56Address: 14.13.253.1244. dig命令dig是一个查询工具DNSnameservers 获取有关主机地址、邮件交换、名称服务器和相关信息的信息 。这个工具可以在任何 linux (Unix) 或macintosh OS X操作系统 。最典型的用途dig是简单地查询单个主机 。
【Linux中20个高级命令】[rumenz@local ~]$ dig rumenz.com; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6 <<>> rumenz.com ;; global options: +cmd ;; Got answer: ;; ->>HEADER<关闭注释行[rumenz@local ~]$ dig rumenz.com +nocomments ; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6 <<>> rumenz.com +nocomments ;; global options: +cmd ;rumenz.com.IN A rumenz.com.14400 IN A 40.216.66.239 ;; Query time: 418 msec ;; SERVER: 192.168.1.1#53(192.168.1.1) ;; WHEN: Sat Jun 29 13:53:22 2013 ;; MSG SIZErcvd: 45关闭来源段[rumenz@local ~]$ dig rumenz.com +noauthority ; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6 <<>> rumenz.com +noauthority ;; global options: +cmd ;; Got answer: ;; ->>HEADER<关闭附加段[rumenz@local ~]$ digrumenz.com +noadditional ; <<>> DiG 9.9.2-P1 <<>> rumenz.com +noadditional;; global options: +cmd;; Got answer:;; ->>HEADER<关闭统计段[rumenz@local ~]$ dig rumenz.com +nostats ; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6 <<>> rumenz.com +nostats ;; global options: +cmd ;; Got answer: ;; ->>HEADER<关闭结果段[rumenz@local ~]$ dig rumenz.com +noanswer ; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6 <<>> rumenz.com +noanswer ;; global options: +cmd ;; Got answer: ;; ->>HEADER<一次禁用所有部分[rumenz@local ~]$ dig rumenz.com +noall ; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6 <<>> rumenz.com +noall ;; global options: +cmd45. uptime命令
uptime命令能够打印系统总共运行了多长时间和系统的平均负载
[rumenz@local ~]$ uptime14:37:10 up4:21,2 users,load average: 0.00, 0.00, 0.0446. wall命令
管理员最重要的命令之一,wall向使用他们登录的每个人发送消息mesg权限设置为 yes 。该消息可以作为参数给出wall,也可以发送到 wall 的标准输入 。
[rumenz@local ~]$ wall "we will be going down for maintenance for one hour sharply at 03:30 pm"Broadcast message from root@localhost.localdomain (pts/0) (Sat Jun 29 14:44:02 2013): we will be going down for maintenance for one hour sharply at 03:30 pm47. mesg命令
让你控制人们是否可以使用 write 命令,通过屏幕向你发送文本 。


推荐阅读