Jump to content

Moving files AND directories with mv command


Recommended Posts

I am trying to move all the contents of the current directory I am in into an other directory. I gave the following command but it moves only the files not the directories and sub-directories/files in it.

bash-2.05a$ mv ./*.* ../testbed/

 

I am sure its something simple ... which I coudn't find in the man pages(or am I blind?) :unsure:

 

Thanks

Jeffery

Link to comment
Share on other sites

mv ./* ../testbed

 

that should do it for you. mv automatically does recursive. your problem was using ./*.* because directories would not have a dot anywhere in them, unless of course you place a dot somewhere in their name.

 

mv * ../testbed

will also work

Link to comment
Share on other sites

thanks, but that example gives me the following results:

bash-2.05a$ mv ./ ../testbed/
mv: cannot overwrite directory `../testbed/.'
bash-2.05a$ mv ./ ../testbed
mv: cannot overwrite directory `../testbed/.'

 

testbed directory already exists... do I have to delete it before doing it ?

 

 

[edit].... ooops sorry... re-trying again with the proper code.... :oops:

Edited by paCkeTroUTer
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...