On my server, I am in the folder:
/path/to/www/some_folder/
Now I want to move all the contents of this folder to the parent folder i.e. www
What should I do?
Will this work:
/path/to/www/some_folder/mv -R . ../
mv * ../
is almost enough, unless there are dotfiles that you also need to move, and in a www directory there might well be for example .htaccess
files.
So you want something like
mv * .[^.]* ../
or in zsh, which is nice enough to not expand .*
to ..
, you have
mv * .* ../
or
setopt globdots
mv * ../
This should do:
mv * ../
Because of the way mv works, you will not need the recursive option.
mv: cannot move
.' to../.': Device or resource busy
some_folder/some_folder
, in which case many of themv
commands will fail; probably the simplest case there is to rename the directory first.