moodLearning Wiki


This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
linux-commandline-tips [2018/12/10 21:20]
serbizadmin [Differences]
linux-commandline-tips [2019/05/28 16:29] (current)
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
 <​code>​ <​code>​
 fdupes --recurse dir1/ dir2/ </​code>​ fdupes --recurse dir1/ dir2/ </​code>​
-  * find a word in a file +  * find a **word** in a file 
 <​code>​ <​code>​
 grep -rnw '/​path/​to/​files/'​ -e "​pattern"</​code>​ grep -rnw '/​path/​to/​files/'​ -e "​pattern"</​code>​
-  * find all socket files your system runs+  * find all **socket** files your system runs
 <​code>​ <​code>​
 find / -type s find / -type s
 +  * find the latest file in a folder/​subfolder
 +find . -type f -printf '%T@ %P\n' | sort -n | awk '​{print $2}'
 </​code>​ </​code>​
 ====== Differences====== ====== Differences======
Line 33: Line 37:
 cat /dev/null > modsec_audit.log</​code>​ cat /dev/null > modsec_audit.log</​code>​
 See also "log rotate"​ on mL wiki. See also "log rotate"​ on mL wiki.
 +  * remove everything else except...
 +rm -rf !(filename)</​code>​
 +This works only if extglob is enabled. So
 +shopt -s extglob</​code>​
 +====== PHP======
 +  * View php config
 +php -r "print phpinfo();"​ | grep "​.ini"​
 +php -i | grep in