Centos 常見操作

上限下線發表於2020-12-18


一、程式安裝

1. re|sz上傳下載命令

//1.安裝
yum -y install lrzsz 

//2.上傳
rz

//3.下載
sz [檔名]

2. JDK安裝

  • JDK8:
    https://www.cnblogs.com/wandoupeas/p/centos_jdk_install.html

  • JDK11:
    https://www.cnblogs.com/biem/p/13307438.html

  • JDK14:
    上傳安裝包到 /data/java

    //安裝jdk14
    tar -xzvf jdk-14.0.2_linux-x64_bin.tar.gz
    

3. unzip 解壓命令

https://blog.csdn.net/wxyjuly/article/details/79398559

4.git安裝

https://www.cnblogs.com/jhxxb/p/10571227.html

5. Telnet安裝

https://www.cnblogs.com/sjpv/p/11812238.html

6. dstat命令安裝

https://www.cnblogs.com/shoufeng/p/9739805.html

7. iostat安裝及使用

https://www.cnblogs.com/architectforest/p/12628399.html

iostat -xmt 1
Key fields from iostat:
%util: this is the most useful field for a quick check, it indicates what percent of the time the device/drive is in use.
avgrq-sz: average request size. Smaller number for this value reflect more random IO operations.

8. wget命令安裝

yum -y install wget

9. crul安裝

yum -y install curl

二、環境配置

1. 防火牆埠

https://www.cnblogs.com/heqiuyong/p/10460150.html

//1.檢視防火牆所有開放的埠
firewall-cmd --zone=public --list-ports

//2.開發埠
firewall-cmd --zone=public --add-port=27017/tcp --permanent

//3.生效
firewall-cmd --reload

//4 檢視埠
netstat -lnpt
//檢視指定埠
netstat -lnpt |grep 5672

2. 連線數設定

https://blog.csdn.net/hunhun1122/article/details/79391147?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.edu_weight&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.edu_weight

3. 網路超時設定

https://segmentfault.com/a/1190000021057175
https://docs.mongodb.com/v3.6/faq/diagnostics/#adjusting-the-tcp-keepalive-value

//使網路超時設定5分鐘,超時後檢測3次,每次30秒
vim /etc/sysctl.conf
//加入如下內容
net.ipv4.tcp_keepalive_time=300
net.ipv4.tcp_keepalive_intvl=30
net.ipv4.tcp_keepalive_probes=3

sysctl -p
sysctl -a | grep keepalive

三、命令參考

1. java cpu、記憶體分析命令

https://www.cnblogs.com/wu-wu/p/11923250.html

2. top命令詳細

https://blog.csdn.net/xujiamin0022016/article/details/89072116

3. tar解壓縮

// 1.打包壓縮目錄
tar -czvf kdnn_hall_20201209.tar.gz kdnn_hall_20201209121360/

4. 目錄檔案操作

// 1.刪除backups目錄30天之前修改的檔案
find backups/ -mtime +30 -delete

相關文章