SSH 命令,使用证书登录,指定端口可缺省
ssh -i ~/.ssh/cent -p 22 root@server
SCP 命令,远程传输命令
scp -i ~/.ssh/cent -p 22 root@server:/home/test.file 'd:/downloads/'
从本地复制到远程
scp -i ~/.ssh/cent -p 22 'd:/test.file' root@server:/home/test.file
注意的是 windows系统下 'd:/test.file'
与 /d/test.file
含义一致且必须要引号
压缩
tar -czvf test.tar.gz /home/test/
解压到指定目录
tar -zxvf /test.tar.gz -C /home/download
解压zip文件
unzip -o test.zip -d /home/download
查询进程
ps -aux | grep java
树状图
pstree -aup |grep lozye
后台托管
nohup ./program >/dev/null 2>&1 &
在使用shell时
# 需要指定完整的nohup与文件执行路径
/usr/bin/nohup /home/runner/program >/dev/null 2>&1 &
chmod a+rx file1.txt
+ 表示增加权限
- 表示取消权限
= 表示唯一设定权限
where nano
在centos里默认只有whereis
whereis nano
ls -at --full 2020*/*history.log
ls -lt 2020*/*history.log