Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I flatten a single level of directories in a shell command?

Tags:

bash

unix

I've found lots of scripts which will recursively flatten all the contents of the subfolders and the subfolders of those subfolders of a directory. But I just want to flatten one level and keep the subfolders intact. How would I go about doing that with maybe a bash script?

like image 423
Steve Moser Avatar asked Nov 30 '25 05:11

Steve Moser


1 Answers

mv */* .

If you don't care about hidden directories, it's as simple as that.

like image 121
John Kugelman Avatar answered Dec 01 '25 23:12

John Kugelman