Linux 系統管理常用命令

一、用戶切換

su 用戶切換

 

二、進程觀察命令

ps 顯示進程

ps -v 顯示虛擬內存相關

ps -a 顯示所有用戶進程

ps -e 顯示所有進程,忽略所有者

ps -f 顯示所有相關信息

ps -u test48 顯示test48用戶進程

ps -G grp1 顯示grp1組進程

 

常用命令爲ps -ef

 

 

三、進程相關命令

renice +1 9911 對9911進程降低優先級,可取-20到+19,默認爲0,-20優先級最高

 

renice -1 9911 提升9911進程優先級

 

kill 9911 結束進程9911

KILL 9911 強制結束進程9911

 

 

四、啓動方式

/etc/inittab文件中包含系統默認啓動到哪個等級,共有0-6個等級

0 halt

1 single user mode

2 multiuser,without NFS

3 full multiuser mode

4 unused

5 X11

6 reboot

 

五、服務列表

chkconfig --list 顯示所有當前服務狀態

 

chkconfig --list | grep httpd

chkconfig --list | grep sendmail

chkconfig --list | grep nfs

chkconfig --list | grep named

chkconfig --list | grep smb

chkconfig --list | grep sshd

chkconfig --list | grep telnet

chkconfig --list | grep Wuftpd

chkconfig --list | grep ftp

 

chkconfig telnet on | off

chkconfig httpd on | off

 

service httpd strat | stop

 

 

六、關閉系統

shutdown -h 關閉系統halt

shutdown -r 重啓

shutdown -r now 立即重啓

shutdonw -r 23:30

shutdown -r +15

shutdonw -r +30

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章