命令3

系统管理命令

查看日历

cal查看日历详细的其他选项可以使用cal --help查看帮助

查看时间

date 查看时间,用于显示给定格式的当前时间,或者设置系统时间

caicai@caicai-VirtualBox:~$ date
2018年 10月 19日 星期五 19:58:36 CST
caicai@caicai-VirtualBox:~$ date --help
Usage: date [OPTION]... [+FORMAT]
  or:  date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]
Display the current time in the given FORMAT, or set the system date.

查看进程

查看进程主要有三种方式:

  1. ps
    Usages:
    ps [options]
Basic options (基本选项): 说明
-A, -e all processes 所有进程
-a all with tty, except session leaders,
a all with tty, including other users
-d all except session leaders
-N, --deselect negate selection
r only running processes
T all processes on this terminal
x processes without controlling ttys
  1. top可以动态的显示进程
  2. ntop

结束进程

结束进程可以使用kill pid来结束进程,pid指进程号

关机重启

在linux终端中可以使用shutdown来关机,reboot来重启或者使用init

命令 说明
reboot 重启
shutdown 关机,shutdown -h 时间可以指定关机时间

检测磁盘空间

可以使用df命令来检测磁盘空间df -h可以显示占用情况

检测目录所占大小

命令du可以查看当前每个目录所占大小

选项 说明

查看网络

  1. 使用ifconfig可以用来查看网卡相关信息
    选项|说明
  2. ping 检测网络是否连通

安装及更新包

  1. sudo apt-get install 包名 安装包
  2. sudo apt-get remove 名字删除包
  3. sudo apt-get update更新源
  4. sudo apt-get upgrade更新已经安装的包
  5. apt-cache depend package了解使用该包的依赖包
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章