about mv


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers about mv
# 1  
Old 12-22-2011
about mv

Directory contains following files
file1.txt
file1.sh
file2.txt
file2.sh
file3.txt
file3.sh
info(directory)
i want to move all the text files to info directory.So i executed below command

mv '*.txt' /info

but i am getting

mv: *.txt: No such file or directory

can we handle this scenaio using mv?
# 2  
Old 12-22-2011
1) goto the particular directory

2) execute the below command

Code:
mv *.txt info/

if you give /info then it will search the info directory in root path
# 3  
Old 12-22-2011
Quote:
Originally Posted by vmachava
can we handle this scenaio using mv?
Putting '*.txt' inside single-quotes like that has prevented * from expanding. mv doesn't understand the string '*.txt' to have any special meaning, because filename globbing is something that happens inside the shell, not inside mv.

Remove the single-quotes and it will work.
# 4  
Old 12-22-2011
about mv

yes it is working.Smilie

i tried with mv *.txt info\ it is working

Last edited by vmachava; 12-22-2011 at 11:14 AM..
 
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question