Move all files up one directory
Posted: 04 Mar 2021 05:04
Hello, I hope someone can help, I'd like to create a script to be run from "Main Directory" to move any files three subdirectories below up one level, this needs to be able to use a method of wildcards for directories as there are many constantly changing directories, the "Main Directory" itself is also a variable I just wish to be able to move script to this directory and run from there. there are potentialy other files in other directories that don't want to be moved, to demonstrate...
Main Directory/ Random folder jhi/ Random folder jgy/ Random folder jhi/ files that want to be moved to Random folder jgy (up one level)
Main Directory/ Random folder mnu/ Random folder rts/ Random folder pih/ files that want to be moved to Random folder rts (up one level)
Main Directory/ Random folder aft/ Random folder tfg/ Random folder kjk/ files that want to be moved to Random folder tfg (up one level)
Main Directory/ Random folder kje/ Random folder wth/ Random folder pyt/ files that want to be moved to Random folder wth (up one level)
Thanks in advance to any help you may be able to offer.
Main Directory/ Random folder jhi/ Random folder jgy/ Random folder jhi/ files that want to be moved to Random folder jgy (up one level)
Main Directory/ Random folder mnu/ Random folder rts/ Random folder pih/ files that want to be moved to Random folder rts (up one level)
Main Directory/ Random folder aft/ Random folder tfg/ Random folder kjk/ files that want to be moved to Random folder tfg (up one level)
Main Directory/ Random folder kje/ Random folder wth/ Random folder pyt/ files that want to be moved to Random folder wth (up one level)
Thanks in advance to any help you may be able to offer.