Categories
Linux Tutorial Series

Linux Tutorial Series – 104 – The pgrep and pkill commands

Here is the video version, if you prefer it:

Today, I will just throw a bug in your ear (this is a colloquialism in Croatia for “useful for you to know”) and tell you about two commands I have used – pgrep and pkill.

You most likely won’t be needing those commands in most cases, but sometimes you know only the process name, but don’t know its ID and you want to end the process. Then you can use pgrep in combination with xargs (see here: (“Can I chain pgrep with kill?,” n.d.)⁠) or use pkill with the process name as the argument (“pkill(1) – Linux man page,” n.d.)⁠.

Hope you learned something useful!

References

Can I chain pgrep with kill? (n.d.). Retrieved February 10, 2020, from https://unix.stackexchange.com/questions/138202/can-i-chain-pgrep-with-kill

pkill(1) – Linux man page. (n.d.). Retrieved February 10, 2020, from https://linux.die.net/man/1/pkill

NewsletterUpdates on interesting things I am doing

Subscribe to my newsletter to keep abreast of the interesting things I'm doing. I will send you the newsletter only when there is something interesting. This means 0% spam, 100% interesting content.

Leave a Reply

Your email address will not be published.