12 lines
659 B
Bash
12 lines
659 B
Bash
#!/usr/bin/env bash
|
|
|
|
# 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.
|
|
|
|
# Get a grep command to not find itself
|
|
<command> | grep '[p]attern'
|
|
# will find instances of 'pattern' in the output of <command> 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". |