Skip to content

Instantly share code, notes, and snippets.

@darktef
Created November 24, 2018 16:17
Show Gist options
  • Save darktef/643269dfa7d50eb2154e549476abcebd to your computer and use it in GitHub Desktop.
Save darktef/643269dfa7d50eb2154e549476abcebd to your computer and use it in GitHub Desktop.
find . -type d -not -empty -exec echo mv \{\}/README.md \{\}.md \;
# This is to preview the command first with echo
find . -type d -empty -print # to show the folder to be deleted
find . -type d -empty -delete # to delete the empty folder
# https://unix.stackexchange.com/questions/46322/how-can-i-recursively-delete-empty-directories-in-my-home-directory
mv myfolder/* .
# move the folder content one level up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment