#!/bin/sh # # Show the file types of multimedia files # magic=/usr/share/misc/magic-mm if [ $# -eq 0 ]; then echo "usage: smmt file|directory ..." >&2 exit 1 fi for f in "$@"; do if [ -d "$f" ]; then find "$f" \( -type f -o -type l \) -exec file -m $magic '{}' ';' else file -m $magic "$f" fi done .