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 [2017/03/04 09:02] serbizadmin |
linux-commandline-tips [2019/03/13 00:15] serbizadmin [Find Stuff] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | | + | ~~NOTOC~~ |
- | fdupes --recurse dir1/ dir2/ | + | ====== Find Stuff====== |
- | * find a word in a file | + | |
- | grep -rnw '/ | + | < |
+ | fdupes --recurse dir1/ dir2/ </ | ||
+ | * find a **word** in a file | ||
+ | < | ||
+ | grep -rnw '/ | ||
+ | * find all **socket** files your system runs | ||
+ | < | ||
+ | find / -type s | ||
+ | </ | ||
+ | * find the latest file in a folder/ | ||
+ | < | ||
+ | find . -type f -printf '%T@ %P\n' | sort -n | awk ' | ||
+ | </ | ||
+ | ====== Differences====== | ||
+ | * between files, showing side by side | ||
+ | < | ||
+ | diff -y file1 file2 | less | ||
+ | </ | ||
+ | * differences of files between directories | ||
+ | < | ||
+ | diff <(ls -a /dir1/) <(ls -a /dir 2/) | ||
+ | </ | ||
+ | or compare | ||
+ | < | ||
+ | comm <(ls -a /dir/) <(ls -a /dir2/) | ||
+ | </ | ||
+ | \\ | ||
+ | ====== Maintenance====== | ||
+ | * kill a process wholesale | ||
+ | < | ||
+ | kill $(ps aux | grep " | ||
+ | * trim log. example: | ||
+ | < | ||
+ | cat /dev/null > modsec_audit.log</ | ||
+ | See also "log rotate" | ||
+ | \\ | ||
+ | ====== PHP====== | ||
+ | * View php config | ||
+ | < | ||
+ | php -r "print phpinfo();" | ||
+ | </ | ||
+ | or | ||
+ | < | ||
+ | php -i | grep in | ||
+ | </ |