Linux – How to move files and directories to the parent folder in Linux

file managementlinuxUbuntu

In Linux (Ubuntu), how do you move all the files and directories to the parent directory?

Best Answer

find . -maxdepth 1 -exec mv {} .. \;

this will move hidden files as well.

You will get the message:

mv: cannot move `.' to `../.': Device or resource busy

when it tries to move . (current directory) but that won't cause any harm.