In Linux (Ubuntu), how do you move all the files and directories to the parent directory?
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 |
|||||||||||||
|
|
I came here because I'm new to this subject as well. For some reason the above didn't do the trick for me. What I did to move all files from a dir to its parent dir was:
|
|||
|
|
|
Type this in the shell:
That moves ALL the files one level up. The character And, of course, |
|||||||||
|
|
Assuming all your hidden files begin with dot followed by a letter or a number (which they should), you could use
The |
|||
|
|
|
In bash you can use shopt -s dotglob to make * match all files and move them simply by
This is not the best solution since the setting is permanent for the shell until you change it by
but I think it's good to know. |
|||||
|
|
It's simple to move all files and folders to the parent directory in Linux. Go to that folder and use this command:
For example, if your files and folders are as follows:
Go to that folder via cd:
All your files and folders will move to the abcuser folder (parent directory). |
|||||
|
|
A method which causes no errors and works every time:
|
|||
|
|

