LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-16-2015, 07:19 AM   #1
paulgadsdon
LQ Newbie
 
Registered: Mar 2015
Posts: 10

Rep: Reputation: Disabled
Red face Move a folder with all contents


hi

i need to move a directory from a subdomain to the root

the folder i need moved is in subdomains/magdev/public_html/images

and I need to move up to the root public_html of my hosting space, my structure looks like this

public_html
-images
subdomains
-magdev
--public_html
---images

So I need to move the bottom images directory to the top one

Can anyone help


Cheers

Last edited by paulgadsdon; 03-16-2015 at 07:44 AM.
 
Old 03-16-2015, 07:51 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
What have you tried? have you checked the command mv ?
 
Old 03-16-2015, 07:54 AM   #3
ut0ugh1
Member
 
Registered: Oct 2011
Posts: 59

Rep: Reputation: Disabled
sudo mv -R
 
Old 03-16-2015, 07:54 AM   #4
paulgadsdon
LQ Newbie
 
Registered: Mar 2015
Posts: 10

Original Poster
Rep: Reputation: Disabled
Yes, just cant quite get it

mv /images/* /../public_html/images*


Or something like this. i am in the directory

subdomains/magdev/public_html

Cheers
 
Old 03-16-2015, 08:01 AM   #5
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
sudo mv /full/path/to/images /full/path/to/new/location/images
 
1 members found this post helpful.
Old 03-16-2015, 08:13 AM   #6
paulgadsdon
LQ Newbie
 
Registered: Mar 2015
Posts: 10

Original Poster
Rep: Reputation: Disabled
Yes that makes sense, but does that move the images or the folders?

I have folders inside folders so need to recursive

I have to be careful here as I have 16000 images and 4.8GB

Thanks

Last edited by paulgadsdon; 03-16-2015 at 08:18 AM.
 
Old 03-16-2015, 08:24 AM   #7
AnanthaP
Member
 
Registered: Jul 2004
Location: Chennai, India
Posts: 952

Rep: Reputation: 217Reputation: 217Reputation: 217
I don't know why linux/unix users seem to be unwilling to try GUI solutions. Is it macho to try CLI without a clue?

Since nothing is mentioned about distinct users, I presume that you are in the correct login and having all rights. ie no user rights issues.

A simple drag and drop in your favourite (or default X system)should do it.

OK

Last edited by AnanthaP; 03-16-2015 at 08:34 AM.
 
Old 03-16-2015, 08:53 AM   #8
paulgadsdon
LQ Newbie
 
Registered: Mar 2015
Posts: 10

Original Poster
Rep: Reputation: Disabled
Thumbs down

Quote:
Originally Posted by AnanthaP View Post
I don't know why linux/unix users seem to be unwilling to try GUI solutions. Is it macho to try CLI without a clue?

Since nothing is mentioned about distinct users, I presume that you are in the correct login and having all rights. ie no user rights issues.

A simple drag and drop in your favourite (or default X system)should do it.

OK
Oh please, i am working on a server, i only have shell access and I have never, ever seen a linux server with a GUI
 
Old 03-16-2015, 08:59 AM   #9
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
A directory is a container. Moving the directory will move (obviously) everything in it. What else can happen?
 
Old 03-16-2015, 05:52 PM   #10
Dopeamin
LQ Newbie
 
Registered: Feb 2011
Posts: 1

Rep: Reputation: 1
cd into directory you moving.
cd subdomains/magdev/public_html/images
then do mv * /public_html/images
 
1 members found this post helpful.
Old 03-16-2015, 07:14 PM   #11
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
Quote:
Originally Posted by paulgadsdon View Post
I have to be careful here as I have 16000 images and 4.8GB
Try it on a small test directory first?

jlinkels
 
1 members found this post helpful.
Old 03-17-2015, 06:14 AM   #12
paulgadsdon
LQ Newbie
 
Registered: Mar 2015
Posts: 10

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Dopeamin View Post
cd into directory you moving.
cd subdomains/magdev/public_html/images
then do mv * /public_html/images
I marked this as useful but this isnt going to work either as the subdomains directory is at the same level as the root

I need to go ip on level and copy the images folder and then go down two level sand paste

AHHHHHHHHHHHHHH
 
Old 03-17-2015, 09:49 AM   #13
Beryllos
Member
 
Registered: Apr 2013
Location: Massachusetts
Distribution: Debian
Posts: 529

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Quote:
Originally Posted by paulgadsdon View Post
I marked this as useful but this isnt going to work either as the subdomains directory is at the same level as the root

I need to go ip on level and copy the images folder and then go down two level sand paste

AHHHHHHHHHHHHHH
I am surprised this isn't solved already. Solutions have been posted.

Earlier you wrote "move," and pan64's solution would work fine:
Code:
sudo mv /full/path/to/images /full/path/to/new/location/images
It moves the directory and everything in it (including subdirectories and their contents).

In your latest post, you wrote "copy," and that is a little different. You could use cp -R:
Code:
cp -R /full/path/to/images /full/path/to/new/location/images
preceded by sudo if necessary. The -R means recursive.

Last edited by Beryllos; 03-17-2015 at 10:07 AM. Reason: typo in second code section
 
Old 03-17-2015, 10:02 AM   #14
Beryllos
Member
 
Registered: Apr 2013
Location: Massachusetts
Distribution: Debian
Posts: 529

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Quote:
Originally Posted by paulgadsdon View Post
i need to move a directory from a subdomain to the root

the folder i need moved is in subdomains/magdev/public_html/images

and I need to move up to the root public_html of my hosting space, my structure looks like this

public_html
-images
subdomains
-magdev
--public_html
---images

So I need to move the bottom images directory to the top one
One more question: Does the images directory at the "root" level already exist? That complicates things.
 
Old 03-17-2015, 05:55 PM   #15
joe_2000
Senior Member
 
Registered: Jul 2012
Location: Aachen, Germany
Distribution: Void, Debian
Posts: 1,016

Rep: Reputation: 308Reputation: 308Reputation: 308Reputation: 308
Quote:
Originally Posted by jlinkels View Post
Try it on a small test directory first?

jlinkels
This is absolutely what you should be doing! The question sounds to me as if you were messing with a production server. If you are not comfortable with the most basic commands like mv / cp you definitely want to run some dummy operations, ideally on another machine before doing the real move...
 
  


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
[SOLVED] Trying to move a file from folder to folder in Ubuntu get a message: Permissio Denied AlexBB Linux - Newbie 13 12-09-2014 07:42 PM
Extracting the contents of a folder in a CPIO archive to another folder Refractor Linux - Software 4 07-10-2012 05:12 PM
Scripts to list folder contents and copy images from folder and subfolders brunces Linux - Newbie 6 11-03-2011 01:23 PM
want to 'tar' a folder without some contents of folder shipon_97 Linux - Newbie 5 10-13-2007 04:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:45 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