Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am in some directory on my linux hosting. I want to move all files from relative subdir1 to dir2, dir2 being under root dir. So I type

mv ./subdir1/*.* ~/dir2/

but it doesn't work it says it

cannot stat './subdir1/*.*'
share|improve this question

3 Answers 3

up vote 1 down vote accepted

Try just ./subdir1/* and see if that works. Running -v with the mv might help for debugging.

share|improve this answer
    
There probably aren't any files that match . in this directory. –  kbyrd Apr 11 '10 at 1:58

If, as you say, you want to move all files, then the pattern *.* is not correct because you are asking for all files that have an extension (try executing ls *.*).

The correct command would be:

mv ./subdir1/* ~/dir2/

If this does not work, then probably the administrator disabled the shell "pathname expansion" mechanism using the -f switch (see man sh).

share|improve this answer

subdir1 either is empty, or a broken symlink or doesn't exist or there are no files in it with dots in their names.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.