常用命令
-
lsof -i:8080
执行时查看不到结果,此端口可能也是占用状态.需要sudo权限 -
scp 源 目的
scp -r root@11.11.11.12:/home/xxx/ localhost:/xxx/
-
tail -n 1000 app.log|grep -o '.*节目任务'
只输出前面一部分日志 -
grep
grep -A 10 'xxx' xxx.log 前后多行
grep -i 忽略大小写
grep -V 'xxx' xxx.log 不匹配
grep -o '正则' xxx.log,
正则中的次数匹配 \{m,n\}:至少m次,至多n次。ab\{0,3\}c=ac,abc,abbc,abbbc
字符串或grep -E '123|abc' filename
egrep '123|abc' filename
限制每行结果的长度 grep xxx aaa.log | cut -c1-200
cut截断前200个字符
- tar -zxvf
- tar -cvfz xxx.tar.gz xxxxdir
-
zip unzip
-
curl -H "Content-Type:application/json" -d '{"name":"name"}' 'localhost:8080/setUser'
wget url注意使用‘’, 防止&引起问题
-
ss
-
netstat
-
iostat -x 10
每隔10秒统计一次io状态 -
tcpdump
-
ethtool
-
ip
-
ifconfig
-
tree
-
seq
-
nc 网络监听或者连接外部网络
开启网络监听时 外部系统可以使用telnet连接
Ncat: socket: Address family not supported by protocol QUITTING. 使用ipv4, 默认会使用v4 v6, 如果v6禁用了,就会出现这个错误
nc -lk4 8080
@@@build beautiful things, share happiness@@@