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:
Old drive with lots of music or unsorted drive? This command will play all mp3 files in a folder and after playing one song or pressing q, it will ask you if you want to delete the file.
There are 4 alternatives - vote for the best!
The glob pattern * expands to all files, no need for the 'ls' command.
The quotes around "$i" make sure filenames with spaces in them are handled correctly.
mplayer determines if it is a media file and plays it, or gives errors and the loop asks if this file has to be removed.
If you can do better, submit your command here.
You must be signed in to comment.