Find the longest filename in a directory tree

Ever wondered what the longest filename is in a directory tree? This command will tell you:

ben@xyz:/srv/blog$ ls -R | awk '{ print length, $0 }' | sort -rn | head -1
73 reorganising_large_directories_with_efficient_remote_rsync_update.doctree

On a similar note, this commands prints the longest path (so directories+filename) length:

ben@xyz:/srv/blog$ find | awk '{ print length, $0 }' | sort -rn | head -1
101 ./blog/html/_sources/2013/12/04/reorganising_large_directories_with_efficient_remote_rsync_update.txt