0%

Linux命令备忘

Linux命令备忘

  1. xargs占位符
    1
    echo aaa |xargs -I {} python3 test.py {} {}.xlsx
  2. 查看进程启动时间
    1
    ps -eo pid,lstart,etime,cmd | grep nginx
  3. 找出大于500m的文件
    1
    find / -type f -size +500M -print0 |xargs -0 ls -l
  4. Debian显示已安装的软件包
    1
    apt list --installed
  5. 批量杀进程
    1
    ps aux |grep hydra |awk '{printf "%s\n", $2}' |xargs kill -9
  6. apt-get配置代理
    1
    export http_proxy=http://192.168.137.1:1080
  7. 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'
  8. Debian设置SSH自启动
    1
    update-rc.d  ssh enable
  9. 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
  10. 查找重复行并统计出现次数,例:统计各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

本文持续更新