Linux命令02--系統管理

 <1>查看當前日曆:cal

<2>顯示或者設置時間

設置時間格式(須要管理員權限);通常都是有ntp服務的,你的系統會根據這個對照互聯網時間linux

<3>查看進程信息:ps

全部和系統相關的 auxwindows

[root@localhost ~]# ps -aux

 

<4>殺死進程kill

 

<5>關機重啓:reboot、shutdown、init

windows是單用戶,linux是多用戶能夠多人操做使用。centos

<6>檢測磁盤空間:df

[root@localhost ~]# df
Filesystem              1K-blocks    Used Available Use% Mounted on
/dev/mapper/centos-root  17811456 1770616  16040840  10% /
devtmpfs                   486744       0    486744   0% /dev
tmpfs                      498976       0    498976   0% /dev/shm
tmpfs                      498976    7856    491120   2% /run
tmpfs                      498976       0    498976   0% /sys/fs/cgroup
/dev/sda1                 1038336  132616    905720  13% /boot
tmpfs                       99796       0     99796   0% /run/user/0
[root@localhost ~]# df -lh
Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/centos-root   17G  1.7G   16G  10% /
devtmpfs                 476M     0  476M   0% /dev
tmpfs                    488M     0  488M   0% /dev/shm
tmpfs                    488M  7.7M  480M   2% /run
tmpfs                    488M     0  488M   0% /sys/fs/cgroup
/dev/sda1               1014M  130M  885M  13% /boot
tmpfs                     98M     0   98M   0% /run/user/0

<7>檢測目錄所佔磁盤空間:du

 

[root@localhost ~]# du
0    ./test
56    .
[root@localhost ~]# cd /bin/
[root@localhost bin]# du
105680    .
[root@localhost bin]# du -lh
110M    .
[root@localhost bin]# 
[root@localhost bin]# du -alh
152K    ./cp
144K    ./cpio
0    ./captoinfo
52K    ./csplit
8.0K    ./clear
44K    ./cut
...
...
48K    ./filterdiff
4.0K    ./fixcvsdiff
0    ./flipdiff
0    ./grepdiff
52K    ./interdiff
0    ./lsdiff
110M    .
[root@localhost bin]# cd -
/root
[root@localhost ~]# du -alh
4.0K    ./.bash_logout
4.0K    ./.bash_profile
4.0K    ./.bashrc
4.0K    ./.cshrc
4.0K    ./.tcshrc
4.0K    ./anaconda-ks.cfg
4.0K    ./.bash_history
12K    ./.123.py.swp
4.0K    ./ls.txt
4.0K    ./kris-1.tar.gz
4.0K    ./kris-2.tar.bz2
4.0K    ./mmmm.zip
0    ./test/123_2.py
0    ./test/345link_2.py
0    ./test/345link.py
0    ./test
56K    .
[root@localhost ~]# 

 <8>top顯示運行中的進程

 

[root@localhost ~]# top
top - 17:49:54 up  2:03,  2 users,  load average: 0.00, 0.01, 0.05
Tasks:  99 total,   1 running,  98 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.3 us,  0.0 sy,  0.0 ni, 99.7 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem :   997956 total,   709144 free,   135940 used,   152872 buff/cache
KiB Swap:  2097148 total,  2097148 free,        0 used.   692464 avail Mem 

   PID USER      PR  NI    VIRT    RES    SHR S %CPU %MEM     TIME+ COMMAND                                      
     1 root      20   0  128236   6868   4080 S  0.0  0.7   0:02.73 systemd                                      
     2 root      20   0       0      0      0 S  0.0  0.0   0:00.00 kthreadd                                     
     3 root      20   0       0      0      0 S  0.0  0.0   0:00.16 ksoftirqd/0                                  
     5 root       0 -20       0      0      0 S  0.0  0.0   0:00.00 kworker/0:0H                                 
     6 root      20   0       0      0      0 S  0.0  0.0   0:00.17 kworker/u256:0                               
     7 root      rt   0       0      0      0 S  0.0  0.0   0:00.00 migration/0                                  
[root@localhost ~]# q  按q結束

 <9>查看或配置網卡信息:ifconfig

 

 

 

 <10>測試遠程主機連通性:ping

 

相關文章
相關標籤/搜索