diff --git a/bash/one_liners.bash b/bash/one_liners.bash index c5a0da0..01f1556 100644 --- a/bash/one_liners.bash +++ b/bash/one_liners.bash @@ -2,5 +2,11 @@ # How to strip leading "./" in "find" find -type f -printf '%P\n' -# From find manual: %P File's name with the name of the command line argument under which it was found removed. + # From find manual: %P File's name with the name of the command line argument under which it was found removed. +# Get a grep command to not find itself + | grep '[p]attern' + # will find instances of 'pattern' in the output of but not the grep command itself. + # Ref: https://stackoverflow.com/questions/20528894/how-does-ps-aux-grep-pattern-exclude-grep-itself + # The pattern "[p]attern" will not match the literal string "[p]attern". Instead it will match strings + # with exactly one char from the 1-character class "[p]", followed by "attern". \ No newline at end of file