#!/bin/sh # remove all music from cache shorter than a specified length mkdir -p /tmp/music for NAME in ~/music/*.mp3 do if expr `echo \`wc -c $NAME\` | cut -d ' ' -f 1` \< 400000 > /dev/null then echo remove $NAME : `echo \`wc -c $NAME\` | cut -d ' ' -f 1` # and are moved to /tmp, and deleted at next restart mv "$NAME" /tmp/music fi done