I use the below command to move files

mv *.gz directoryname

but directory name has spell mistake and the file with directory name has been generated with unknown format. And I lost my file.

How can I get them back? is there anyway to get them from the directoryname which is generated while running mv command.

Please let me know if you want me to more clear on this.



If you use those command, the *.tgz files should go to directoryname, even if directoryname didn't exist, system will automaticly create directory with your mispelled-directoryname, try to find your file using

cd directoryname
ls -la | grep tgz

if your desired file didn't there, maybe you can find it using locate or whereis

Hope that's help you, even a little.

  • 1
    mv will either rename (in the case that *.tgz expands to a single file) or exit with error mv: target ‘directoryname’ is not a directory (in the case that *.tgz expands to more than one file) – steeldriver Feb 7 '16 at 15:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.