Linux命令备忘
- xargs占位符
1
echo aaa |xargs -I {} python3 test.py {} {}.xlsx
- 查看进程启动时间
1
ps -eo pid,lstart,etime,cmd | grep nginx
- 找出大于500m的文件
1
find / -type f -size +500M -print0 |xargs -0 ls -l
- Debian显示已安装的软件包
1
apt list --installed
- 批量杀进程
1
ps aux |grep hydra |awk '{printf "%s\n", $2}' |xargs kill -9
- apt-get配置代理
1
export http_proxy=http://192.168.137.1:1080
- wget设置代理
1
wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2rc1.tgz -e 'https_proxy=http://192.168.137.1:1080'
- Debian设置SSH自启动
1
update-rc.d ssh enable
- Kali设置阿里云源
1
2
3修改/etc/apt/sources.list文件为以下内容:
deb https://mirrors.aliyun.com/kali/ kali-rolling main non-free contrib
deb-src https://mirrors.aliyun.com/kali/ kali-rolling main non-free contrib - 查找重复行并统计出现次数,例:统计各IP出现次数
1
cat ip.txt |grep -E -o "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][ 0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" |sort |uniq -c > ipncount.txt