Posts Tagged ‘search’

Command Line – search for all images in a folder

Wednesday, August 3rd, 2011

find /opt/wherever/you/want/to/search -type f -name *.jpg -ls

You might have to do it a few times for different file types.  Or you can just leave the “-name *.jpg” part out and it will just give you your report on ALL of your files.

If you don’t like full bytes you could pipe some commands together…..

find /opt/wherever/you/want/to/search -type f -name *.jpg | awk ‘{system(“ls -lh \”"0″\”")}’

Thanks Dave for this tidbit of information!

Command Line – search

Tuesday, July 26th, 2011

Using terminal:

$ grep –color=auto -Ri “page.xml” *

 --color=auto will color the findings
-R will do a recursive search
-i is case insensitive
If you want to search but not show results from hidden folders
$ grep -R "page.xml" * | grep -v '/.svn/'
If you want to do a recursive search, do not search a certain type of folder ( hidden ) and color the results
$ grep -Ir --color=auto --exclude="*\.svn*" "page.xml" *