4. 命令: dig

dig是查询DNS 域名服务器的工具,可以查询的主机地址、 邮件交流、 域名服务器相关的信息。在任何 Linux (Unix) 或 Macintosh OS X 操作系统上,都可以使用该工具。dig的最典型的用法是单个主机的查询。

  1. [avishek@tecmint ~]$ dig tecmint.com 
  2. <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6 <<>> tecmint.com 
  3. ;; global options: +cmd 
  4. ;; Got answer: 
  5. ;; ->>HEADER< 

关闭注释行

  1. [avishek@tecmint ~]$ dig tecmint.com +nocomments 
  2. <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6 <<>> tecmint.com +nocomments 
  3. ;; global options: +cmd 
  4. ;tecmint.com.           IN  A 
  5. tecmint.com.        14400   IN  A   40.216.66.239 
  6. ;; Query time: 418 msec 
  7. ;; SERVER: 192.168.1.1#53(192.168.1.1) 
  8. ;; WHEN: Sat Jun 29 13:53:22 2013 
  9. ;; MSG SIZE  rcvd: 45 

关闭认证块

  1. [avishek@tecmint ~]$ dig tecmint.com +noauthority 
  2. <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6 <<>> tecmint.com +noauthority 
  3. ;; global options: +cmd 
  4. ;; Got answer: 
  5. ;; ->>HEADER< 

关闭其他块

  1. [avishek@tecmint ~]$ dig  tecmint.com +noadditional 
  2. <<>> DiG 9.9.2-P1 <<>> tecmint.com +noadditional 
  3. ;; global options: +cmd 
  4. ;; Got answer: 
  5. ;; ->>HEADER< 

关闭统计块

  1. [avishek@tecmint ~]$ dig tecmint.com +nostats 
  2. <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6 <<>> tecmint.com +nostats 
  3. ;; global options: +cmd 
  4. ;; Got answer: 
  5. ;; ->>HEADER< 

关闭回复块

  1. [avishek@tecmint ~]$ dig tecmint.com +noanswer 
  2. <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6 <<>> tecmint.com +noanswer 
  3. ;; global options: +cmd 
  4. ;; Got answer: 
  5. ;; ->>HEADER< 

关闭所有块

  1. [avishek@tecmint ~]$ dig tecmint.com +noall 
  2. <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6 <<>> tecmint.com +noall 
  3. ;; global options: +cmd 

阅读更多10 个Linux Dig 命令实例。

5.命令: uptime

你连接到你的 Linux 服务器时发现一些不寻常或恶意的东西,你会做什么?猜测......不,绝不!你可以运行uptime来验证当服务器无人值守式到底发生了什么事情。

  1. [avishek@tecmint ~]$ uptime 
  2. 14:37:10 up  4:21,  2 users,  load average: 0.00, 0.00, 0.04 

6. 命令: wall

对系统管理员来说一个最重要的命令.wall发送一条消息到大家登录端将其 mesg 权限设置为"yes"。这条信息可以被wall作为参数,或者可以将它作为wall的标准输入。

  1. [avishek@tecmint ~]$ wall "we will be going down for maintenance for one hour sharply at 03:30 pm" 
  2. Broadcast message from root@localhost.localdomain (pts/0) (Sat Jun 29 14:44:02 2013): 
  3. we will be going down for maintenance for one hour sharply at 03:30 pm 

7. 命令: mesg

其他人们可以使用"wtrite"命令,将在在向您发送文本到屏幕上。你可以控制是否显示。

  1. mesg [<strong>n</strong>|<strong>y</strong><strong>n</strong> - prevents the message from others popping up on the screen. <strong>y</strong> – Allows messages to appear on your screen. 


相关内容