Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm trying to find the path of a file and move it.

When I try realpath, it is not useful.

For example : I want to move the file All Hail the Generalist - Vikram Mansharamani - Harvard Business Review.html

Using realpath:

realpath 'All Hail the Generalist - Vikram Mansharamani - Harvard Business Review.html
/home/x/Downloads/All Hail the Generalist - Vikram Mansharamani - Harvard Business Review.html

But I can't do :

mv /home/x/Downloads/All Hail the Generalist - Vikram Mansharamani - Harvard Business Review.html /home/

I need something like that :

mv  /home/x/Downloads/All\ Hail\ the\ Generalist\ -\ Vikram\ Mansharamani\ -\ Harvard\ Business\ Review.html
share|improve this question

1 Answer 1

Have you tried:

mv '/home/x/Downloads/All Hail the Generalist - Vikram Mansharamani - Harvard Business Review.html' /home/

Notice the single quotes to include the full filename and prevent shell parsing of the string.

share|improve this answer
    
Hey man !!! You are rigth! it works !! tkx :) –  PriX Oct 30 '12 at 21:47
    
Accept the answer, then! –  ckhan Oct 31 '12 at 7:13

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.