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 have a lot of mp3 files located at various levels of subdirectories inside a single folder and I want to move them all to a single directory, what command could I use to do this?


share|improve this question

marked as duplicate by jasonwryan, Drav Sloan, Gilles, slm, Anthon Sep 23 '13 at 3:03

This question was marked as an exact duplicate of an existing question.

True, it is. Is there a way to close this myself? – user47742 Sep 22 '13 at 21:54
@ChristophePrakash write an answer yourself. You can then accept it in about 2 days. – Martin von Wittich Sep 22 '13 at 22:11
You can just delete it... – jasonwryan Sep 22 '13 at 23:04
@MartinvonWittich No, there's no point in answering a duplicate question. Christophe: your question will be closed as a duplicate when 2 more people come along to vote for it. You don't need to do anything. Don't delete your question: we keep duplicate questions around as search fodder. – Gilles Sep 22 '13 at 23:35
@Gilles ah, ok. I've added my flag. – Martin von Wittich Sep 22 '13 at 23:39
shopt -s globstar
mv /old_dir/**/*.mp3 /new_dir/
share|improve this answer