Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to sync 2 folders containing audio files of multiple types (WMA, MP3, M4V,...).

I want to sync these folders but the sync process should only take into account the file names, not the extensions. So, if folder A contains "the suburbs.mp3" and folder B contains "the suburbs.m4v", the sync program should consider these 2 files the same (and not sync them).

I was looking into the documentation of rsync but I can't seem find a way to do this.

Does anyone have a suggestion, or maybe suggestions for other software that can do this?

share|improve this question

You could create empty files with all possible extensions and call rsync with --ignore-existing.

find A -type f \( -name '*.flac' -o -name '*.m4v' -o -name '*.mp3' -o '*.ogg' -o '*.wma' \) \
     -exec sh -c '
  for base; do
    for ext in flac m4v mp3 ogg wma; do : >>"$base.$ext"; done;
  done' _ {} +
# Do the same on B …
rsync -a --ignore-existing A B

You may be interested in mp3fs, a FUSE stackable filesystem that provides a view of a directory tree where all audio files appear as MP3. I don't think it would particularly help with your question, but it may be an alternate way to solve your problem or otherwise prove useful.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.