Friday, February 27, 2009

Batch rename files with bash

How to batch rename files in a one-line bash script:

for f in *.txt; do mv ./"$f" "$f.newname"; done

and the other direction:

for f in *.mine; do mv $f `echo $f | sed 's/\(.*\).newname/\1/'`; done

From this post.

Tuesday, February 10, 2009

Changing eclipse "highlight occurences" color

When you click on something in eclipse (say, a variable), it highlights all occurrences of that variable. The default color does not work well for dark themes. The color is changed from:

Window->Preferences->General->Editors->Text Editors->Annotations->(C/C++) Occurrences