PDA

View Full Version : [SOLVED] bash: going back 1 subdirectory for mv command



mferarri
March 18th, 2012, 05:26 AM
hi ubuntuforums,

if i want to move pictures from
'home/user/pics/animals/downloaded/google_images/mammals/scary/' to 'home/user/pics/animals/downloaded/google_images/mammals/' (back 1 subdirectory)is there a shorter way to do it than:
mv foo.jpg home/user/pics/animals/downloaded/google_images/mammals/

this is an example for something similar that im doing btw.:)

zombifier25
March 18th, 2012, 05:29 AM
In the command line, .. stands for the parent directory, so your code could be rewritten as this:

mv foo.jpg ..

mferarri
March 18th, 2012, 05:32 AM
In the command line, .. stands for the parent directory, so your code could be rewritten as this:

mv foo.jpg ..

D'OH! Why didn't i think of that!!!! thanks! You're a superstar!:KS