I read in an online flash card that the command is:pkill -u bob $(pgrep -u bob)However, I think this is wrong. I think it's saying:Kill all the processed owned by bob, and 4572\n4600Because:[bob@localhost ~]$ pgrep -u bob45724600Also, it gives an error:[bob@localhost ~]$ pkill -u bob $(pgrep -u bob)pkill: only one pattern can be providedTry `pkill --help' for more information.Which makes sense because you can't have newlines in usernames, right?I think the command should only be:pkill -u bobTo kill all processes owned by bobWhile the command:pgreg -u bob Gives all processes owned by bobI'm wondering:Am I uses the right commands as intended?Is my analysis of the incorrect way accurate?
How to kill all processes owned by `user` on Centos 7?
process;process management;pgrep;pkill
You Are CorrectWrong:   pkill -u bob $(pgrep -u bob)Correct: pkill -u bobThe flash card probably meant to show:kill $(pgrep -u bob)which would kill all of the processes returned by pgrep -u bob.