1834156 Members
2594 Online
110064 Solutions
New Discussion

Re: moving directory

 
hp admin
Frequent Advisor

moving directory

Hi all,

I have two directory: test and test1

I want to change the name of the first one "test" to "test1", but the command "mv" transfert "test" directory into "test1".

Please any help.
7 REPLIES 7
hp admin
Frequent Advisor

Re: moving directory

Please without, changing the name of "test1" directory.
Alex Lavrov.
Honored Contributor

Re: moving directory

I don't think I understood the question.

You want test to be renamed to test1? But you can't have two directories with the same name in same location ....
I don't give a damn for a man that can only spell a word one way. (M. Twain)
Peter Godron
Honored Contributor

Re: moving directory

Hi,
can you please confirm:
two directories (test and test1)
you want to rename the test dir to test1
what uis to happen with any data in test1?

otherwise:
rm -r test1
mv test test1

Regards
hp admin
Frequent Advisor

Re: moving directory

Thanks for anwsers,

We suppose that all directories are empty.

Here what I do not to launch:

mv test1 toto
mv test test1

I search a command that rename test to test1 whitout renaming the test1 directory.
Alex Lavrov.
Honored Contributor

Re: moving directory

But again, you can't rename test into test1 if you already have test1 at the same location you have test ....

The only way to it, it's to remove test1 or to rename it.
I don't give a damn for a man that can only spell a word one way. (M. Twain)
Peter Godron
Honored Contributor

Re: moving directory

hp admin,
if your directories are empty you can remove the temp1 directory and then mv (rename) the test directory to test1.
Start situation, directories:
test test1
conmmand: rm test1

This leaves directory
test
command: mv test test1

This leaves directory
test1

So you have moved test to test1!
Try the process in /tmp

Regards

hp admin
Frequent Advisor

Re: moving directory

Hi all and thanks to all answering me.

I think there is no solution about what I search.

I have copied the content of tes directory to test1 one.

Thank's again.