I want to move all my drupal files in www folder to html folder. I don't know how to do this in terminal and I'm not sure if all folder and files including hidden ones are drupal in the www folder, is there a way of checking the lesser obvious ones or would www have been empty before and any hidden files will auto recreate?
mv -- *(D) html
mv will complain that it can't move
html to itself, but will still move the rest.
shopt -s dotglob mv -- * html
FIGNORE='@(.|..)' mv -- * html
mv -- * .??* .[!.] html
mv -- * .[!.]* ..?* html
(you're likely to get errors for those of the patterns that have no match. That should be harmless but will still cause the exit status to be non-zero so in script you would not be able to distinguish that with a failure to move files).
The easy way:
# from the www directory cd .. mv www html mkdir www mv html www/
This assumes you don't already have a
html directory at the same level as
www. If you do, pick a different name:
cd .. mv www temp_name mkdir www mv temp_name www/html
A naive option (don't try it!) would be:
mv * .* html - this will however try to move
.. too, which is not quite what you want. I usually do something like
mv * .??* html - this moves normal file and hidden files with names that have at least 3 characters in them, effectively skipping