find all flash video by searching mimetype=x-flv

Forum rules
Before you post please read how to get help

find all flash video by searching mimetype=x-flv

Postby grimdestripador on Wed Aug 03, 2011 1:25 am

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/
Last edited by grimdestripador on Thu Aug 04, 2011 8:54 pm, edited 3 times in total.
User avatar
grimdestripador
Level 6
Level 6
 
Posts: 1069
Joined: Fri Feb 16, 2007 2:26 am

Linux Mint is funded by ads and donations.
 

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

Postby grimdestripador on Wed Aug 03, 2011 2:34 am

##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/
User avatar
grimdestripador
Level 6
Level 6
 
Posts: 1069
Joined: Fri Feb 16, 2007 2:26 am

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

Postby rich_roast on Wed Aug 03, 2011 5:14 pm

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.
User avatar
rich_roast
Level 6
Level 6
 
Posts: 1136
Joined: Sat Sep 05, 2009 4:37 pm

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

Postby grimdestripador on Thu Aug 04, 2011 8:48 pm

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.
User avatar
grimdestripador
Level 6
Level 6
 
Posts: 1069
Joined: Fri Feb 16, 2007 2:26 am


Return to Scripts & Bash

Who is online

Users browsing this forum: No registered users and 2 guests