diff --git a/cheatsheets/grep b/cheatsheets/grep index 3a01723..fced336 100644 --- a/cheatsheets/grep +++ b/cheatsheets/grep @@ -20,3 +20,7 @@ grep -E "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" file #Find IP add # Find all files who contain {pattern} in the directory {directory}. # This will show: "file:line my research" grep -rnw 'directory' -e "pattern" + +# Exclude grep from your grepped output of ps. +# Add [] to the first letter. Ex: sshd -> [s]shd +ps aux | grep '[h]ttpd' diff --git a/cheatsheets/ps b/cheatsheets/ps index 3710a90..75d6155 100644 --- a/cheatsheets/ps +++ b/cheatsheets/ps @@ -9,3 +9,7 @@ ps -aufoouser # To list every process with a user-defined format: ps -eo pid,user,command + +# Exclude grep from your grepped output of ps. +# Add [] to the first letter. Ex: sshd -> [s]shd +ps aux | grep '[h]ttpd'