系统管理命令
查看日历
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.
查看进程
查看进程主要有三种方式:
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 |
top
可以动态的显示进程ntop
结束进程
结束进程可以使用kill pid
来结束进程,pid指进程号
关机重启
在linux终端中可以使用shutdown
来关机,reboot
来重启或者使用init
命令 | 说明 |
---|---|
reboot |
重启 |
shutdown |
关机,shutdown -h 时间 可以指定关机时间 |
检测磁盘空间
可以使用df
命令来检测磁盘空间df -h
可以显示占用情况
检测目录所占大小
命令du
可以查看当前每个目录所占大小
选项 | 说明 |
---|
查看网络
- 使用
ifconfig
可以用来查看网卡相关信息
选项|说明 ping
检测网络是否连通
安装及更新包
sudo apt-get install 包名
安装包sudo apt-get remove 名字
删除包sudo apt-get update
更新源sudo apt-get upgrade
更新已经安装的包apt-cache depend package
了解使用该包的依赖包