1. 程式人生 > >centos簡單命令備忘

centos簡單命令備忘

1.檢視當前目錄

[[email protected] bin]# df -h

 

2.檢視指定目錄

在命令後直接放目錄名,比如檢視“usr”目錄使用情況:

[[email protected] bin]# df -h /java/

 

3.檢視記憶體使用情況

[[email protected] bin]# free -m

 

4.釋放記憶體

[[email protected] bin]# sync

[[email protected] bin]# echo 3 > /proc/sys/vm/drop_caches

 

5.開放指定埠

[[email protected] bin]# firewall-cmd --permanent --zone=public --add-port=8983/tcp

重新啟動防火牆

[[email protected] bin]# firewall-cmd --reload

 

5.檢視檔案末尾幾行

[[email protected] bin]#  tail log.log 

tail -n 55 不加引數預設顯示末尾10行