-1

I have the following folder structure:

parent
├── child1
├── child2
└── child3
    └── childofchild
        └── childofchildofchild
            └── file.txt

I want to move childofchildofchild into a new folder, but keep the structure preceding it so the end result would be the following:

newfolder
└── child3
    └── childofchild
        └── childofchildofchild
            └── file.txt

Edit: I need the files removed from the original folder, not duplicated.

Nathan Van Dyken
  • 342
  • 1
  • 8
  • 21
  • Possible duplicate of [Linux: copy and create destination dir if it does not exist](https://stackoverflow.com/questions/1529946/linux-copy-and-create-destination-dir-if-it-does-not-exist) – David Florez Jul 04 '17 at 20:26
  • So you want parent/child3/childofchild/foo to remain unchanged? – William Pursell Jul 04 '17 at 22:47

1 Answers1

0

I don't really understand what are you trying to do, but something as ...?

mkdir parent/newfolder && mv parent/child3 parent/newfolder

I think I'm missing something tho

criw
  • 587
  • 1
  • 5
  • 15