基本命令
-
查看文件修改时间等信息
stat 文件名 -
SFTP
sftp -P 22 账号@ip -
SCP 从本地上传到远程
scp 本地路径和名称 账号@ip:远程路径和名称 -
从远程下载到本地
scp -P 端口号 账号@ip:远程路径和名称 本地路径和名称 -
Linux查看端口号
ps -aux |grep 名字/端口
#通过端口号查看占用的进程id
netstat -nap | grep pid -
查看磁盘 io
iostat -x 1 -
查看文件行数
wc -l 文件名.txt -
压缩命令
tar -zcvf 文件名 文件1 文件2 文件n … -
查看磁盘占用大小
du-sh * -
清理磁盘某个目录3天外的文件
find /绝对路径 -mtime +3 -name “*这里写模糊匹配的名字” |xargs rm -
清空某个文件
:>文件名 -
查找文件指定行
sed -n ‘700,800p’ iotlog |grep 1c -
linux起别名
vi /User/telltao/.bash_profile
添加 alias t5=‘cd /outbound/tomcat8085/bin/’
使其生效 source /Users/telltao/.bash_profile -
查询某个目录的数据量
ls -al |wc -l -
设置linux时区为上海
timedatectl status
timedatectl list-timezones | egrep -o “Asia/."
timedatectl list-timezones | egrep -o "Asia/Shang.”
timedatectl set-timezone “Asia/Shanghai” -
curl
curl http://127.0.0.1:8085/mobileApi/captcha.sp -X POST -H “Content-Type:application/x-www-form-urlencoded” -H “token:H9jrE”
-d '{ “uniqueCode”:“00000000-4eea-920b-0033-c5870033c587” } ’