Help me setting an alias that represents this command:
ps -u -p $(fuser 5432/tcp 2>/dev/null)
#output:
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
postgres 423310 0.0 0.1 506528 14544 ? S Jun25 1:48 /usr/pgsql-11/bin/postgres
I have tried:
alias p2p='ps -u -p $(fuser $1 2>/dev/null)', but it doesn't work
Well, looks like I've found something that works.
Like @Barmar commented, a function works, but
fuserinsists in writing to error ouput.So I did a
functionand aaliasthat mutesstderroffuseroutput: