cd 到指定目录
cd /usr/local/redis
cp 当前文件 目标文件 ,复制,更改文件用
cp test.txt test2.txt
scp 远程复制文件
scp root@10.10.10.10:/opt/soft/nginx-0.5.38.tar.gz /opt/soft/
mkdir 创建目录
mkdir test
删除文件
rm -rf test.txt
grep 查看日志
grep -C 30 'close connection error' /mnt//data/logs/enc-oss-canvas-pro/info.log
查看gz日志
zcat info.log.gz | grep 'error'
vi vim 编辑文件
vim /data/test.txt
tailf test.txt查看实时文件 ;tail -100f test.txt 查看最后100行
tailf test.txt
ssh 远程连接服务器
ssh root@10.10.10.1
zip 压缩文件 .zip
zip test.txt
zip -r test.zip test/
unzip 解压缩zip包 注意压缩包文件路径
unzip test.zip
tar -zxvf test.tar.gz 解压文件tar包
tar -zxvf test.tar.gz
du -sh *查看大文件 内存使用情况
du -sh *
df -h 查看磁盘情况 df -a
netstat -tunlp | grep 端口号 查看端口使用情况
查找文件目录
find / -name mysql
查找进程
ps -def | grep mongod
显示当前文件大小
ls -alh
统计当前目录文件大小
du -sh *
dump堆文件
jmap -dump:live,format=b,file=/mnt/a.txt 17752^C