add aliases to list open files and exec them

This commit is contained in:
Paul Trowbridge 2023-03-24 22:28:59 -04:00
parent fa3bf6ff37
commit 33276ce8e9

View File

@ -92,6 +92,11 @@ alias ll='ls -alFh'
alias la='ls -A' alias la='ls -A'
alias l='ls -CF' alias l='ls -CF'
alias lb='lsblk -o+FSAVAIL,FSUSED,FSUSE%,MODEL,PARTTYPENAME,STATE' alias lb='lsblk -o+FSAVAIL,FSUSED,FSUSE%,MODEL,PARTTYPENAME,STATE'
alias opg="lsof 2>/dev/null +D . | grep 'pg.*swp$' | awk '{print \$9}' | sed 's/\.swp//g' | sed 's/\/\./\//g'"
#alias opg="lsof +D . | grep 'pg.*swp$' | awk '{print \$9}' | sed 's/\.swp//g' | sed 's/\/\./\//g' | xargs -r realpath"
alias osw="lsof 2>/dev/null +D . | awk '\$NF ~ /swp$/ {print \$9}' | sed 's/\.swp//g' | sed 's/\/\./\//g'"
alias xpg="lsof 2>/dev/null +D . | grep 'pg.*swp$' | awk '{print \$9}' | sed 's/\.swp//g' | sed 's/\/\./\//g' | xargs -r $PG -f"
alias xsw="lsof 2>/dev/null +D . | grep '.*swp$' | awk '{print \$9}' | sed 's/\.swp//g' | sed 's/\/\./\//g' | xargs -r $PG -f"
# Add an "alert" alias for long running commands. Use like so: # Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert # sleep 10; alert