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 [2018/11/13 14:49] serbizadmin |
linux-commandline-tips [2019/03/13 00:14] serbizadmin [Find Stuff] |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ~~NOTOC~~ | ||
+ | ====== Find Stuff====== | ||
* looking for duplicate filenames in 2 directories | * looking for duplicate filenames in 2 directories | ||
< | < | ||
Line 5: | Line 7: | ||
< | < | ||
grep -rnw '/ | 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 a process wholesale | ||
< | < | ||
Line 12: | Line 35: | ||
cat /dev/null > modsec_audit.log</ | cat /dev/null > modsec_audit.log</ | ||
See also "log rotate" | See also "log rotate" | ||
+ | \\ | ||
+ | ====== PHP====== | ||
+ | * View php config | ||
+ | < | ||
+ | php -r "print phpinfo();" | ||
+ | </ | ||
+ | or | ||
+ | < | ||
+ | php -i | grep in | ||
+ | </ |