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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...