
Get metadata of an audio or video file:
$ afinfo 'some_multimedia_file.m4a''
Get the duration in the unit of seconds:
$ afinfo 'some_multimedia_file.m4a' | awk '/estimated duration/ { print $3 }'
References
- https://stackoverflow.com/questions/8933053/check-duration-of-audio-files-on-the-command-line