5. uname命令

"uname"命令就是Unix Name的简写。显示机器名,操作系统和内核的详细信息。

  1. root@tecmint:~# uname -a 
  2. Linux tecmint 3.8.0-19-generic #30-Ubuntu SMP Wed May 1 16:36:13 UTC 2013 i686 i686 i686 GNU/Linux 

注意: uname显示内核类别, uname -a显示详细信息。上面的输出详细说明了uname -a

  • “Linux“: 机器的内核名
  • “tecmint“: 机器的分支名
  • “3.8.0-19-generic“: 内核发布版本
  • “#30-Ubuntu SMP“: 内核版本
  • “i686“: 处理器架构
  • “GNU/Linux“: 操作系统名

6. history命令

“history”命令就是历史记录。它显示了在终端中所执行过的所有命令的历史。

  1. root@tecmint:~# history 
  2. 1  sudo add-apt-repository ppa:tualatrix/ppa 
  3. 2  sudo apt-get update 
  4. 3  sudo apt-get install ubuntu-tweak 
  5. 4  sudo add-apt-repository ppa:diesch/testing 
  6. 5  sudo apt-get update 
  7. 6  sudo apt-get install indicator-privacy 
  8. 7  sudo add-apt-repository ppa:atareao/atareao 
  9. 8  sudo apt-get update 
  10. 9  sudo apt-get install my-weather-indicator 
  11. 10 pwd 
  12. 11 cd && sudo cp -r unity/6 /usr/share/unity/ 
  13. 12 cd /usr/share/unity/icons/ 
  14. 13 cd /usr/share/unity 

注意:按住“CTRL + R”就可以搜索已经执行过的命令,它可以你写命令时自动补全。

  1. (reverse-i-search)`if': ifconfig 

7. sudo命令

“sudo”(super user do)命令允许授权用户执行超级用户或者其它用户的命令。通过在sudoers列表的安全策略来指定。

  1. root@tecmint:~# sudo add-apt-repository ppa:tualatrix/ppa 

注意:sudo 允许用户借用超级用户的权限,然而"su"命令实际上是允许用户以超级用户登录。所以sudo比su更安全。

并不建议使用sudo或者su来处理日常用途,因为它可能导致严重的错误如果你意外的做错了事,这就是为什么在linux社区流行一句话:

 “To err is human, but to really foul up everything, you need root password.”

  1. <span style="font-size:9pt;line-height:1.5;">“人非圣贤孰能无过,但是拥有root密码就真的万劫不复了。” </span> 


相关内容