centos 常用命令 持續

2021-10-01 15:33:28 字數 2685 閱讀 6789

1. 檢視系統核心

uname -a

2. ip位址

ifconfig (ifconfig ens33)

ip addr

3. selinux

getenforce/setenforce

vi /etc/selinux/config -> selinux=enforce/disabled

4. netstat

介面: netstat -i

路由: netstat -r

5. network

service network restart

6. tail

-f: --follow

-n: --lines

-s: --sleep-interval

7. ps

a: 當前終端所有程序

u: 格式含當前使用者

x: 當前使用者所有終端程序

-e: 系統所有程序

-l: long

-f: full

8. top 實時動態檢視系統執行

-u -p

-c 9. df 磁碟使用

-h-i

10. free 記憶體

-b/-k/-m/-t

11. netstat -anp | grep nginx

[root@k8s-master conf]# netstat -anp | grep nginx

tcp        0      0 0.0.0.0:81              0.0.0.0:*               listen      49278/nginx: master 

unix  3      [ ]         stream     connected     257179   49278/nginx: master  

unix  3      [ ]         stream     connected     257180   49278/nginx: master

12. ps aux | grep nginx

[root@k8s-master conf]# ps aux | grep nginx

10000     22072  0.0  0.1  23824  2536 ?        ss   23:02   0:00 nginx: master process nginx -g daemon off;

10000     22363  0.0  0.0  24288  1484 ?        s    23:02   0:00 nginx: worker process

10000     22547  0.0  0.1  30136  2604 ?        ss   23:02   0:00 nginx: master process nginx -g daemon off;

10000     22762  0.0  0.0  30580  1580 ?        s    23:02   0:00 nginx: worker process

root      49278  0.0  0.0  20536   608 ?        ss   23:20   0:00 nginx: master process nginx

nobody    49279  0.0  0.0  20980  1316 ?        s    23:20   0:00 nginx: worker process

root      53721  0.0  0.0 112724   996 pts/0    r+   23:23   0:00 grep --color=auto nginx

13. ps -elf | grep nginx

[root@k8s-master conf]# ps -elf | grep nginx

4 s 10000     22072  22000  0  80   0 -  5956 sigsus 23:02 ?        00:00:00 nginx: master process nginx -g daemon off;

5 s 10000     22363  22072  0  80   0 -  6072 ep_pol 23:02 ?        00:00:00 nginx: worker process

4 s 10000     22547  22530  0  80   0 -  7534 sigsus 23:02 ?        00:00:00 nginx: master process nginx -g daemon off;

1 s 10000     22762  22547  0  80   0 -  7645 ep_pol 23:02 ?        00:00:00 nginx: worker process

1 s root      49278      1  0  80   0 -  5134 sigsus 23:20 ?        00:00:00 nginx: master process nginx

5 s nobody    49279  49278  0  80   0 -  5245 ep_pol 23:20 ?        00:00:00 nginx: worker process

0 s root      53799   9811  0  80   0 - 28182 pipe_w 23:23 pts/0    00:00:00 grep --color=auto nginx

14. 

CentOS常用命令

1.顯示當前目錄所有的檔案和目錄資訊 ls list ls xx目錄 檢視指定目錄下邊的檔案資訊 2.顯示當前檔案目錄位置 pwd 3.目錄之間切換 cd 目錄名字 cd 切換到上級目錄 4.切換到完全命令模式 init 3 進入命令模式 init 5 進入視覺化操作介面 5.使用者切換到超級管理員...

centos 常用命令

遠端鏈結 連交換機 telnet 192.168.1.241 username password 查埠 dis inter br 退出 ctrl 再按 quit 程序 殺程序 kill 9 5144 或 kill term 5144 9表示無條件 顯示程序 ps auxw 或 ps ef grep ...

centos 常用命令

建立目錄 mkdir p 目錄名 開啟目錄 cd 目錄名 1 cd 進入當前使用者的家目錄 2 cd 進入上次目錄 3 cd 進入上一級目錄 4 cd 進入當前目錄 檢視當前路徑 pwd 刪除目錄 rm rf 目錄名 rm 只能刪除空目錄 複製 cp 選項 目錄或檔案 目標目錄 1 r 複製目錄 2...