commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
change the *.avi to whatever you want to match, you can remove it altogether if you want to check all files.
There are 6 alternatives - vote for the best!
You're behind on your TV catch-up, but how far behind? This command tries to open mplayer against all files in the current dir. If it's a video file it will contain ID_LENGTH, which is summed and output in hours, minutes and seconds.
Someone better at awk could probably reduce this down a lot.
Better awk example, using only mplayer, grep, cut, and awk.
Use case insensitive regex to match files ending in popular video format extensions and calculate their total time. (traverses all files recursively starting from the current directory)
If you can do better, submit your command here.
You must be signed in to comment.