This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
linux-commandline-tips [2019/03/13 00:15] serbizadmin [Find Stuff] |
linux-commandline-tips [2019/05/28 23:29] serbizadmin [Maintenance] |
||
---|---|---|---|
Line 1: | Line 1: | ||
~~NOTOC~~ | ~~NOTOC~~ | ||
====== Find Stuff====== | ====== Find Stuff====== | ||
- | * looking for duplicate filenames in 2 directories | + | * looking for **duplicate** filenames in 2 directories |
< | < | ||
fdupes --recurse dir1/ dir2/ </ | fdupes --recurse dir1/ dir2/ </ | ||
- | * find a word in a file | + | * find a **word** in a file |
< | < | ||
grep -rnw '/ | grep -rnw '/ | ||
- | * find all socket files your system runs | + | * find all **socket** files your system runs |
< | < | ||
find / -type s | find / -type s | ||
Line 37: | Line 37: | ||
cat /dev/null > modsec_audit.log</ | cat /dev/null > modsec_audit.log</ | ||
See also "log rotate" | See also "log rotate" | ||
+ | * remove everything else except... | ||
+ | < | ||
+ | rm -rf !(filename)</ | ||
+ | This works only if extglob is enabled. So | ||
+ | < | ||
+ | shopt -s extglob</ | ||
\\ | \\ | ||
====== PHP====== | ====== PHP====== |