+++ title = "一些linux命令" date = 2023-01-06 [taxonomies] tags=["linux"] +++ ### 带进度的wc -l ```bash awk 'BEGIN {T=0} (T!=systime()) { printf "%s %s\n",NR,$0 ; T=systime()} END { print NR}' ``` #### 使用 ```bash cat file |awk 'BEGIN {T=0} (T!=systime()) { printf "%s %s\n",NR,$0 ; T=systime()} END { print NR}' ``` ### losf 查找删除文件 ```bash lsof |grep delete | sort -nrk 7| more ``` ### python 内存监测 ```bash pip install memray memray run --live -m module.file ``` ### python cpu监测 ```bash pip install py-spy py-spy top --pid ${pid} ``` ### 批量设置ssh自动登录 ```bash #!/bin/bash # FileName: auto-ssh-login.sh # Revision: 1.0 # Date: 2020-03-25 # Author: baige # Description: the script for auto-ssh-login while read host;do ip=`echo $host | cut -d " " -f1` username=`echo $host | cut -d " " -f2` password=`echo $host | cut -d " " -f3` expect <