20个对Linux专家非常有用命令(1)(4)
4. 命令: dig
dig是查询DNS 域名服务器的工具,可以查询的主机地址、 邮件交流、 域名服务器相关的信息。在任何 Linux (Unix) 或 Macintosh OS X 操作系统上,都可以使用该工具。dig的最典型的用法是单个主机的查询。
- [avishek@tecmint ~]$ dig tecmint.com
- ; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6 <<>> tecmint.com
- ;; global options: +cmd
- ;; Got answer:
- ;; ->>HEADER<
关闭注释行
- [avishek@tecmint ~]$ dig tecmint.com +nocomments
- ; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6 <<>> tecmint.com +nocomments
- ;; global options: +cmd
- ;tecmint.com. IN A
- tecmint.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 SIZE rcvd: 45
关闭认证块
- [avishek@tecmint ~]$ dig tecmint.com +noauthority
- ; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6 <<>> tecmint.com +noauthority
- ;; global options: +cmd
- ;; Got answer:
- ;; ->>HEADER<
关闭其他块
- [avishek@tecmint ~]$ dig tecmint.com +noadditional
- ; <<>> DiG 9.9.2-P1 <<>> tecmint.com +noadditional
- ;; global options: +cmd
- ;; Got answer:
- ;; ->>HEADER<
关闭统计块
- [avishek@tecmint ~]$ dig tecmint.com +nostats
- ; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6 <<>> tecmint.com +nostats
- ;; global options: +cmd
- ;; Got answer:
- ;; ->>HEADER<
关闭回复块
- [avishek@tecmint ~]$ dig tecmint.com +noanswer
- ; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6 <<>> tecmint.com +noanswer
- ;; global options: +cmd
- ;; Got answer:
- ;; ->>HEADER<
关闭所有块
- [avishek@tecmint ~]$ dig tecmint.com +noall
- ; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6 <<>> tecmint.com +noall
- ;; global options: +cmd
阅读更多10 个Linux Dig 命令实例。
5.命令: uptime
你连接到你的 Linux 服务器时发现一些不寻常或恶意的东西,你会做什么?猜测......不,绝不!你可以运行uptime来验证当服务器无人值守式到底发生了什么事情。
- [avishek@tecmint ~]$ uptime
- 14:37:10 up 4:21, 2 users, load average: 0.00, 0.00, 0.04
6. 命令: wall
对系统管理员来说一个最重要的命令.wall发送一条消息到大家登录端将其 mesg 权限设置为"yes"。这条信息可以被wall作为参数,或者可以将它作为wall的标准输入。
- [avishek@tecmint ~]$ 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 pm
7. 命令: mesg
其他人们可以使用"wtrite"命令,将在在向您发送文本到屏幕上。你可以控制是否显示。
- 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.
评论暂时关闭