Changes

Jump to navigation Jump to search
780 bytes added ,  00:34, 29 March 2015
no edit summary
/proc
/media/disk/backups
</source>
 
=== Move a directory up one level ===
Sometimes you can end up with a directory which is nested inside it's intended destination. For example, <code>drush archive-restore (arr)</code> can leave you with <tt>/var/www/drush/drush</tt> and you want the contents of the sub-directory to be at the location of it's parent. Using the BASH shell options for glob control, you can set dotglob and later unset it to be able to move * up. This worked for me on one host, and didn't work on another. For the one that didn't work, mv kept complaining that destination directories were not empty. I don't care if the destination directories exist.... that's the whole point. Uggh!
<source lang="bash">
cd /var/www/drupal/drupal/
shopt -s dotglob
mv -- * ..
shopt -u dotglob
</source>
4,558

edits

Navigation menu