for i in `ls -1 /Users/Username/Downloads/*.QFX 2> /dev/null`; do srm -m $i; done
Script for cron on OSX. Can be adapted for any file pattern.
Could also be done with xargs.
UPDATE
The case-insensitive way to do this is as follows:
for i in `find ~/Downloads/ -maxdepth 1 -iname \*QFX\*`; do srm -m $i; done
Added bonus of no stderr to suppress since we’re using find as opposed to ls.
Task
Create 11 folders in sequence in a given directory:
Week 1
Week 2
…
Week 11
Bash
Pop open Terminal.app, then issue the following command:
for i in {1..11}; do mkdir “Week $i”; done
Extra Bits
This works in reverse as well if you need it to:
for i in {11..1}; do mkdir “Week $i”; done
Design by Simon Fletcher. Powered by Tumblr.
© Copyright 2010