mirror of
https://github.com/cheat/cheat.git
synced 2024-12-18 18:55:06 +01:00
Merge pull request #150 from ImmortalPC/master
[PS,GREP] Exclude grep from your grepped output of ps.
This commit is contained in:
commit
d02e0d98a8
@ -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'
|
||||
|
@ -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'
|
||||
|
12
cheatsheets/xargs
Normal file
12
cheatsheets/xargs
Normal file
@ -0,0 +1,12 @@
|
||||
# find all file name ending with .pdf and remove them
|
||||
find -name *.pdf | xargs rm -rf
|
||||
|
||||
# if file name contains spaces you should use this instead
|
||||
find -name *.pdf | xargs -I{} rm -rf '{}'
|
||||
|
||||
# Will show every .pdf like:
|
||||
# &toto.pdf=
|
||||
# &titi.pdf=
|
||||
# -n1 => One file by one file. ( -n2 => 2 files by 2 files )
|
||||
|
||||
find -name *.pdf | xargs -I{} -n1 echo '&{}='
|
Loading…
Reference in New Issue
Block a user