I would like to know if it's possible to move all subdirectories and their contents within my working directory into the working directory, so that the subdirectories become primary directories in the tree.
for example:
I'm in workingdir
, inside we have folder1
, folder2
, folder3
, etc
now folder 1, 2, and 3 are already primary directories within the working directory, but when we get to folder4
there is a subdirectory within which has the same name folder4
then contents and this continues folder5
, folder6
onto folder100andsomething
.
What I would like is to run a command to move the subdirectories folder4
all the way to folder100andsomething
along with their contents out of the parent directories, and into the working directory,
so in the end I would have folder1
- folder100andsomething
as primary directories and a bunch of erroneous empty parents. To clean up I can run a command to remove all the empty parent directories.
mv folder4/* $(pwd)
?