mv command with files name include spaces
Dear all
one system send files to linux machine and it is name contains spaces and i tried to move it from one directory to other,but it show error ex:- mv -f file one file two mv: target `one' is not a directory ------- that is all :( |
Use quotes:
First type: Code:
mv 'Large File Na Code:
mv 'Large File Name' |
Hi H_TeXMeX_H,
Thanks alot, it is work in command shell. but is not work in bash script please any advice This is from my bash script and it is work with for loop and it is fine when i show the result with echo. but when applied mv command show that error #-------------------------------------------------------------------- mkdir -p /nfs04/archive/${DIR}/${year}/${month}/${day}/ mv -f '{$FILE}' /nfs04/archive/${DIR}/${year}/${month}/${day}/. sleep 5 #--------------------------------------------------------------------- THIS IS THE RESULT OF set -x + mkdir -p /nfs04/archive/A_BCD_EFG_Disk0/2010/10/03/ + mv -f '{A-BCD-EFG-Disk 0-201010031330-4095.SSS}' /nfs04/archive/A_BCD_EFG_Disk0/2010/10/03/. mv: cannot stat `{A-BCD-EFG-Disk 0-201010031330-4095.SSS}': No such file or directory + sleep 5 #----------------------------------------------------------------------- Regards |
I think using backslash-space should work in a script. Suppose your file is called "my file". Then you could try
Code:
mv my\ file newfile ciao, jdk |
Quote:
Thank you, but i use bash script and file name save in parameter and the files has different name for that i can't add backslash-space for it. |
Try:
Code:
mkdir -p "/nfs04/archive/${DIR}/${year}/${month}/${day}/" |
Quote:
Thanks H_TeXMeX_H very much and it is work well. Regards |
All times are GMT -5. The time now is 11:16 PM. |