Skip to content

Instantly share code, notes, and snippets.

@rolfen
Created April 26, 2022 11:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rolfen/4887c6d7a241a25738011f48ca9fa9f3 to your computer and use it in GitHub Desktop.
Save rolfen/4887c6d7a241a25738011f48ca9fa9f3 to your computer and use it in GitHub Desktop.
Flatten subdirectories (Linux)

This

find -type f -exec mv {} ./ \;

turns this

/folder
    /subfolder1
        /subsubfolder
           file3
    /subfolder2
        file1
        file2

into this

/folder
    file1
    file2
    file3
    /subfolder1
      /subsubfolder
    /subfolder2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment