LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-16-2015, 03:37 AM   #1
preetham.66666
Member
 
Registered: Jan 2015
Posts: 33

Rep: Reputation: Disabled
Moving directory


Hi,

I have copied directories from one server to another. that is server A /data to server B /data by mistake i created directory /data and copied now in server B its created like /data/data

I want to move /data/data to /data and need to delete /data/data Please help it has huge data (12TB).

when i tried i am getting below message

mv /data/data/* /data/*
mv: `/data/data/delete-dv3.sh' and `/data/data/delete-dv3.sh' are the same file
 
Old 03-16-2015, 03:59 AM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,
Quote:
Originally Posted by preetham.66666 View Post
when i tried i am getting below message
Code:
mv /data/data/* /data/*
mv: `/data/data/delete-dv3.sh' and `/data/data/delete-dv3.sh' are the same file
You shouldn't have shell glob "*" in the target. Eg, try:
Code:
mv /data/data/* /data/
rmdir /data/data
Evo2.
 
Old 03-16-2015, 04:04 AM   #3
preetham.66666
Member
 
Registered: Jan 2015
Posts: 33

Original Poster
Rep: Reputation: Disabled
Hi Evo2,

I am getting below message

mv: cannot move `/data/data/data' to a subdirectory of itself, `/data/data'
 
Old 03-16-2015, 04:14 AM   #4
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,
Quote:
Originally Posted by preetham.66666 View Post
I am getting below message

mv: cannot move `/data/data/data' to a subdirectory of itself, `/data/data'
There are various solutions. Eg
Code:
mv /data/data /data/data.tmp
mv /data/data.tmp/* /data/
rmdir /data/data.tmp
Where "/data/data.tmp" is just some name for which there is no corresponding "/data/data/data.tmp"

Evo2.
 
Old 03-16-2015, 05:54 AM   #5
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
you can do the following (or something similar) too:
Code:
mv /data/data /data2
rmdir /data
mv /data2 /data
 
Old 03-16-2015, 04:10 PM   #6
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,
Quote:
Originally Posted by pan64 View Post
you can do the following (or something similar) too:
Code:
mv /data/data /data2
rmdir /data
mv /data2 /data
Need to be a little careful here: the OP says this is 12T and presumably /data is a separate partition.

Evo2.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving directory as well Fixit7 Puppy 2 12-08-2014 09:36 PM
[SOLVED] Invoke root directory owner/group while moving file/directory yogesh_attarde Linux - Security 5 04-14-2014 11:36 PM
Moving my directory okayload Linux - General 4 08-12-2007 06:09 PM
Moving my directory okayload Linux - Distributions 1 08-11-2007 07:16 AM
Moving A Directory. reesee Linux - Newbie 6 02-04-2004 02:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration