Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

You must log in to answer this question.