0

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

1 Answer 1

2

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.

1
  • Hey man !!! You are rigth! it works !! tkx :)
    – PriX
    Oct 30, 2012 at 21:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .