Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a directory structure like this:-

/root/directory/subdirectory1
/root/directory/subdirectory2
/root/directory/subdirectory3
/root/directory/subdirectory4

I need all subdirectories to move up 1 level so they are off the root, can someone please help me with the correct syntax from a shell prompt please.

Thanks

Jonathan

share|improve this question
cd /root/directory/
mv ./subdirectory* ../
share|improve this answer
    
Thanks, is there a way to do it without having to specify the names of the subdirectories as there are about 50. Thanks Jonathan – Anonymous Jan 3 '10 at 9:54
mv /root/directory/* /root/
share|improve this answer

Two good references you should bookmark:

http://tldp.org/LDP/Bash-Beginners-Guide/html/index.html

http://tldp.org/LDP/abs/html/index.html

These will help you immeasurably in your bash-fu adventures.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.