系統管理命令
查看日曆
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
瞭解使用該包的依賴包