Ever want to take a massive tree of files and rename them all lowercase? (Ever work between case-sensitive and case-insensitive systems? :\) Here’s my first attempt:
find . -type f -and -not -type d -print0 | xargs -0 -n 1 echo | while read line; do target=$(echo $line | tr A-Z a-z); echo mv \"$line\" \"$target\"; done | less
which looks fine, until you realize that the path is made lowercase too, despite only looking at files. So I googled, and found a StackOverflow page: http://stackoverflow.com/questions/152514/how-to-rename-all-folders-and-files-to-lowercase-on-linux with this bit:
for SRC in `find my_root_dir -depth`
do
DST=`dirname "${SRC}"`/`basename "${SRC}" | tr '[A-Z]' '[a-z]'`
if [ "${SRC}" != "${DST}" ]
then
[ ! -e "${DST}" ] && mv -T "${SRC}" "${DST}" || echo "${SRC} was not renamed"
fi
done
which isn’t careful about spaces in the filename. But otherwise, it’s on to something with dirname and basename. Revisit mine!
find . -type f -and -not -type d -print0 | xargs -0 -n 1 echo | while read line; do target=$(basename "$line" | tr A-Z a-z); target=$(dirname "$line")/$target; mv "$line" "$target"; done
I saw [this](http://www.blogotheque.net/Animal-Collective,3881) a while ago, and it’s pretty great if you like Animal Collective. Sorry I didn’t share earlier.
Allegedly I [know](http://wiki.secondlife.com/wiki/Unicode_In_5_Minutes) my [unicode](http://www.pauloppenheim.com/blog/2008/05/14/the-fog-of-war-mcnamara-and-spidery-ha/) but I still get rad surprises:
䷂ – U+4DC2 HEXAGRAM FOR DIFFICULTY AT THE BEGINNING
I was just upgrading WordPress and noticed I haven’t said much in a *while*! Not for lack of anything going on, but it’s mostly been personal stuff and work stuff. Seeing as this is already a meta post, I’ll summarize for those following my stream that care (hello, facebook).
So I was just [ego surfing](http://en.wikipedia.org/wiki/Egosurfing) and found [a song written by Niko Donburi that has a line about my work persona, Poppy Linden](http://niko-mysecondlife.blogspot.com/2007/12/public-thank-you-to-ll.html). Woot! Here’s the song…
Hey folks! If you’re a unix nerd like me, you probably use rsync for everything. Unfortunately I learned today that if you do `rsync -vaP –delete source dest` you may not have sync’d files. Why? Because that only uses the timestamp.
Yeah.
Anyhow, `rsync -c` is what you want. This does a checksum everytime regardless of timestamp. A word of caution though: it takes *forever*. However, my 80GB cache of corrupted MP3s are thanking me.
Ok, I’m on a youtube binge with no real content lately, but I’m sick. Incapable of any real thought, I bring you this:
(Or at (http://youtube.com/watch?v=X_U2yG3uZp0)). Which I saw courtesy of [Channel Frederator](http://frederatorblogs.com/channel_frederator), which I got from [Miro](http://www.getmiro.com/), a sweet internet video channel program that is making my dusty old TV more useful.