• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 668
  • Last Modified:

How do I move a directory and subdirectory to overwrite another directory in unix

How do I move a directory and subdirectory to overwrite another directory in unix....
I'm unable to use the move command. Here's an example of what I'm trying to do.
>pwd
/var/opt/OV/opt/OV
mv HPOvLIC /var/opt/OV
This doesn't replace the directory under /var/opt/OV

what command can use to do this
0
anthony
Asked:
anthony
1 Solution
 
omarfaridCommented:
What do you mean by overwrite ? why don't you remove that subdir and then move?
0
 
Brian UtterbackPrinciple Software EngineerCommented:
I am a little confused about where you are executing the command and where the HPOvLIC directory is. The pwd command
has printed two directories. Am I correct in assuming that you have a directory /opt/OV/HPOvLIC and you want to move
it to /var/opt, renaming it to /var/opt/OV and replacing the current /var/opt/OV?

If so, then you need to do this:

mv /var/opt//OV /var/opt/OV.old
mv HPOvLIC /var/opt/OV
rm -rf /var/opt/OV.old

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now