A Grep Trick Every User Should Know

A Grep Trick Every User Should Know: The Square Brackets in the Grepped ps Output

Written By
i
iDoLinux
May 26, 2025

Mastering the command line involves more than just knowing the tools—it’s about using them smartly. One subtle but incredibly useful trick when working with grep and ps is using square brackets to filter processes without matching the grep command itself. This technique is especially helpful when you’re scripting or debugging and want clean output. If you’re interested in enhancing your terminal productivity further, check out this guide on smarter tab completion using .inputrc.

i

iDoLinux

Linux Today Logo

LinuxToday is a trusted, contributor-driven news resource supporting all types of Linux users. Our thriving international community engages with us through social media and frequent content contributions aimed at solving problems ranging from personal computing to enterprise-level IT operations. LinuxToday serves as a home for a community that struggles to find comparable information elsewhere on the web.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.