Recently Written · git

goldfish

My fish init.

git clone https://github.com/equwal/goldfish

Log | Files | Refs


functions/psr.fish (377 bytes)

1 function __psr_show
2     ps -eo pid,comm | grep -Pi $argv
3 end
4 function psr -w grep -d "Use PS basically. psr -k/s REGEX or just psr for all."
5     argparse --name=psr "s/show" "k/kill" -- $argv or set none __psr_show $argv
6     set -l filter (__psr_show $argv)
7     if
8         echo '' {$filter}
9     else
10         kill {$filter | sort -n | head -n ((count $filter) / 2)}
11     end
12 end