This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
linux-commandline-tips [2019/03/13 00:15] serbizadmin [Find Stuff] |
linux-commandline-tips [2020/06/03 15:57] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ~~NOTOC~~ | + | |
- | ====== Find Stuff====== | + | |
- | * looking for **duplicate** filenames in 2 directories | + | |
- | < | + | |
- | 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 | + | |
- | </ | + |