Home » Questions » Computers [ Ask a new question ]

Linux rename using parameters and spaces?

Linux rename using parameters and spaces?

Is it possible, in Linux, to rename a file from something without spaces to something containing spaces?

Asked by: Guest | Views: 28
Total answers/comments: 1
Guest [Entry]

"Maybe you need to just put quotes around whole destination path? E.g.

$ touch test
$ a=one
$ b=two
$ mv ""test"" ""$a $b""
$ ls -la
total 8
-rw-r--r-- 1 whitequark whitequark 0 2010-01-27 01:21
-rw-r--r-- 1 whitequark whitequark 0 2010-01-27 01:20
drwxr-xr-x 2 whitequark whitequark 4096 2010-01-27 01:21 .
drwxr-xr-x 80 whitequark whitequark 4096 2010-01-27 01:16 ..
-rw-r--r-- 1 whitequark whitequark 0 2010-01-27 01:21 one two"