linux-常用命令整理
来源:互联网 发布:linux管道符号的作用 编辑:程序博客网 时间:2024/06/16 10:12
1.scp限速下载
scp -l xxxx
xxxx代表kb数,比如2000代表 2000/8=250k/s
2.使用TC对服务器流量进行控制
tc qd add dev eth1 root handle 1: tbf rate 256kbit burst 10000 latency 50ms 速率 256kbit 突发传输 10k 最大延迟 50ms #tc -s qd sh dev eth1 统计#tc qd del dev eth1 root 删除
3.抓包
tcpdump -i eth1 tcp port 6040 -c 10000 -vv -s 0 -w catch.pcap
如果要根据包大小来抓包(主要是过滤大量握手或负载均衡检查包)可以使用 port XXXX and greater NNN (NNN建议200)
或者直接在控制台打印:
tcpdump -i eth1 src host xxx.xxx.xxx.xxx or dst host xxx.xxx.xxx.xxx -Xtcpdump -i em1 tcp port 4400 and \(\(dst host xxx.xxx.xxx.xxx and ! xxx.xxx.xxx.xxx\) or \(src host xxx.xxx.xxx.xxx and ! xxx.xxx.xxx.xxx\)\) and greater 100 -X -Atcpdump -i enp4s0 tcp port 4400 and \(dst host xx or src host xxx.xxx.xxx.xxx\) and greater 150 -A -qtcpdump -i em2 tcp port 4405 and host xxx.xxx.xxx.xxx -A -ptcpdump -i em1 tcp port 4400 and host xxx.xxx.xxx.xxx and greater 150 -A -q
4.立即生效hosts
rcnscd restart
5.查看cpu占用情况
top -p pid -d secs
eg: 每隔两秒检测pid 8888:top -p 8888 -d 2
6.找出占用空间最大的前10个文件或目录
du -cks * | sort -rn | head -n 10
7.查看某字符串所在的文件
grep -rRln "SUCCESS-SEND"
8.删除指定日期前的文件
find log/ -mtime +3 -exec rm -rf {} \;
阅读全文
0 0
- 【linux 常用命令】常用命令整理
- LINUX最常用命令整理
- [整理]Linux常用命令
- linux 常用命令整理
- Linux 常用命令整理
- Linux系统常用命令整理
- Linux下面常用命令整理
- Linux常用命令整理
- linux常用命令整理
- linux常用命令整理
- linux Ftp常用命令整理
- linux常用命令整理
- LINUX常用命令整理
- Linux常用命令整理
- linux 常用命令整理
- Linux常用命令整理
- linux 常用命令分类整理
- linux常用命令整理
- centos 7 下安装postgreSQL
- Spring MVC 框架搭建及详解
- 通过设置偏移 添加RecyclerView分隔线
- LintCode全AC题解(共331题)
- 安卓开发环境搭建
- linux-常用命令整理
- 【原创】如何使用build.gradle优雅的开发Android
- error: taking address of temporary
- Android Studio 内存泄漏分析指南
- Spring MVC 框架搭建及详解
- ConvNet Architectures
- 地推的几个效果提升
- H5上传视频,截取视频第一帧作为视频封面,遇到的坑
- Linux 查看CPU信息