mv: cannot stat with *
I can think of 2 possible reasons why this can happen:
- The source directory may not exist (OR)
- The source directory might be empty
Ignore if neither!
You need to use $USER
for user to expand to your username. /home/user
is only valid if you have a user named user
. This will work if temp1
and temp2
exists in your home directory
mv /home/$USER/temp1/* /home/$USER/temp2
I'll try to help out and clear up the confusion a little:
-
If you want to move a folder and its contents to another one, you enter:
mv ~/Scripts ~/Podcasts
If you want to move a folder's contents but not the folder itself to another folder, you must enter, for example,
mv ~/Scripts/* ~/Podcasts
. You can enterecho ~/Scripts/*
to check the folder's content(If you also need to know about
globstar
, which will allow you to recurse through all directory levels, see this article and this one. It can be enabled with shopt -s globstar, but that will need to be put in .bashrc to work permanently.)
(The tilde
~ in ~/Scripts is expanded to /home/mike/
or your user name automatically by the shell)