Home | Hardware | Internet News |Web Hosting |IT Management |Network Storage
LinuxPlanet
Search 
  Power Search | Tips 

 Front Door
 Discussion
 LinuxEngine
 Opinions
 Reports
 Reviews
 Tutorials
 News
 Technology Jobs

 Browse by subject.
Free Newsletter

Java/Open Source Daily
Linux Today
More Free Newsletters

Be a Commerce Partner


















internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

Print this article
Email this article

   LinuxPlanet / Tutorials







Getting Rid of Nasty Adobe Flash Cookies the Cool Linux Way
Using find for Search and Destroy

Carla Schroder
Friday, March 27, 2009 02:46:02 PM

Once you verify that you have a batch of Flash cookies, find will find and delete them all in one command by using the powerful -exec option, like this:

$ find -iname '*.sol' -exec rm "{}" \;

This means "find all files with the extension .sol and delete them." rm is remove, or delete. "{}" means "replace me with the name of the current file being processed", and the semi-colon means "stop, there are no more commands to execute." The semi-colon must be escaped with the backslash because it has a special meaning to the Bash shell, and we don't want Bash mucking with it.

find is very fast and this will nuke all Flash cookies in an eyeblink. If you're nervous, you can use -ok instead of -exec and you'll be asked to verify each deletion:

$ find -iname '*.sol' -ok rm "{}" \;
$ < rm ... ./s_br.sol > ?

Type y for yes or n for no.

Fun With find and xargs: Sort Flash Cookies By Date

Maybe you want to see your listing of Flash cookies sorted by date. Your first impulse might be to use -exec again, like this:

$ find -iname '*.sol' -exec ls -l "{}" \;

But this won't work, because the -exec option processes one file at a time, so one file at a time will be sent to ls. We want all of the output of find sent in one batch to ls, which is a job for pipes and the xargs command, like this:

$ find -iname '*.sol' | xargs ls -lt

xargs is another endlessly useful command that takes the output of another command and lets you run other commands on it. You can do more than simply view your Flash cookies in date order; see man xargs for inspiration.

Next: Preventing Flash Cookies »

Skip Ahead

1 Using find to See What We're Up Against
2 Using find for Search and Destroy
3 Preventing Flash Cookies





Linux is a trademark of Linus Torvalds.


internet.com home | search | help! | about us

Jupiter Online Media

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers