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/*.*'
link|improve this question
feedback

4 Answers

up vote 1 down vote accepted

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

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

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

link|improve this answer
feedback

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

link|improve this answer
feedback

Try using complete address.

link|improve this answer
-1: What address are you talking about? – kbyrd Apr 10 '10 at 19:01
Not using ~/ as reference. Write out the full address. – data_jepp Apr 10 '10 at 20:58
I think you mean "path" instead of "address". In any case the error was on the first argument, not on the ~/dir/ argument. This answer doesn't make any sense and isn't right. – kbyrd Apr 11 '10 at 1:58
feedback

Your Answer

 
or
required, but never shown