How can I move files from multiple subdirectories into their parent directory?

0
0
Asked By CleverTurtle27 On

I'm trying to move files from various 'docs' directories located inside a main 'DOCS' directory. For example, I want to move all the files from ~/DOCS/docs/* into ~/DOCS/* and then delete the now-empty 'docs' folder. I have over 1000 of these directories, each with different names, and some directories shouldn't change. Sorry if I'm being unclear!

1 Answer

Answered By TechieGuru01 On

It sounds like you want to use the `mv` command. You can do it like this:

`mv -r ~/DOCS/docs/ ~/DOCS/`

Just remember that `mv` stands for move and `-r` means recursive, so it'll handle everything inside 'docs' and any subdirectories. This should work for your case!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.