Monday, February 2, 2015

VIM Search and Replace, dan find file ukuran tertentu

:%s/foo/bar/g
Find each occurrence of 'foo' (in all lines), and replace it with 'bar'.
:s/foo/bar/g
Find each occurrence of 'foo' (in the current line only), and replace it with 'bar'.
Melihat jumlah file dan file size berukuran tertentu

# find . -type f | wc -l
29

# find / -type f -size +10000k -exec ls -lh {} \; | awk '{ print $8 ": " $5 }' | more

atau kebalikannya

find / -type f -size +20000k -exec ls -lh {} \; 2> /dev/null | awk '{ print $NF ": " $5 }' | sort -nrk 2,2 | more

1 comment:

have a question, just spill it :D