Page 1 of 1

find all flash video by searching mimetype=x-flv

Posted: Wed Aug 03, 2011 1:25 am
by grimdestripador

Code: Select all

#!/bin/sh
echo Copyright: grimdestripador 2011 under Linux Mint forums agreement
echo This will find all flash video by searching mimetype=x-flv
date ; echo The following is where you cache is:
export cachePlace=`locate Cache | grep mozilla | grep -v Cache/ | grep /Cache`;  echo $cachePlace

#Hint, I capitalize functions as one would a proper noun. As in "Hello! I'm Mr. Proper Noun, meet my friend Mrs. Proproper Function" 
echo "Please have patience while your mozilla cache is searched.  ETA > 1 Minute. During this time, you may read an explanation of its execution. \n This is an exercise in the use of piping. The program Find is used at the cache folder to execute Mimetype. Mime type then prints into the stream bufer its textual output with filename and mimetype. Lines not containing x-flv are removed using Grep. The rest of the stream is continued to be piped through Sed. Sed continues removing chunks of text evolving into a simple list of return-separated filenames. The current stream of filenames is piped into Xargs which repetitively executes Cp on each of the filenames."
date

find $cachePlace -type f -exec mimetype {} \; | grep x-flv | sed 's#: video/##g' | sed s/x-flv//g | xargs -I {} cp -v {} ~/Downloads/

Re: find all flash video by searching mimetype=x-flv

Posted: Wed Aug 03, 2011 2:34 am
by grimdestripador
##And for your one liner command heroes

Code: Select all

find `locate Cache | grep mozilla | grep -v Cache/ | grep /Cache` -type f -exec mimetype {} \; | grep x-flv | sed 's#: video/##g' | sed s/x-flv//g | xargs -I {} cp -v {} ~/Downloads/

Re: find all flash video by searching mimetype=x-flv

Posted: Wed Aug 03, 2011 5:14 pm
by rich_roast
I'm fond of:

Code: Select all

#Hint, I capitalize functions as one would a proper noun. As in "Hello! I'm Mr. Proper Noun, meet my friend Mrs. Proproper Function"
Proproper is epic.

Re: find all flash video by searching mimetype=x-flv

Posted: Thu Aug 04, 2011 8:48 pm
by grimdestripador
This makes my day. Someone actually read the comments burried in a descriptive comment. I also meant to type Mrs. Proper, but somehow i typoed Mrs. Proper to be Mrs. Proproper. And friend is an odd relationship for someone who has the same last name. Perhaps it should have been wife or sister.