Home > Net >  mv cannot stat '*.txt' : No such file or directory
mv cannot stat '*.txt' : No such file or directory

Time:04-01

Be nice. I'm learning Linux and can't find this answer (I've searched) I'm trying to move all the .txt files in Folder1 to my Documents directory.

~$ ls
Desktop Documents Downloads file1.txt Music Public Templates test user0files.txt user-files.txt Videos
~$ cd ~/Documents
~/Documents$ ls 
Folder1 Folder2 test1.txt test2.txt
~/Documents$ cd ~/Documents/Folder1
~/Documents/Folder1$ ls
bale.txt, ball.txt, bowl.txt, foldernew
~/Documents/Folder1$ mv *.txt ~/Documents
mv: cannot stat '*.txt': No such file or directory

From here I tried moving foldernew by name to ~/Documents and it worked. Can someone explain what I am doing incorrectly?

Thanks so much!!

CodePudding user response:

It looks like you have a bunch of files that end in .txt, (note the comma), so *.txt doesn't find them.

Rename the files to remove the comma and try again.

  • Related