image
image

Go Back   macosx.com > Mac Help Forums > Unix & X11

Reply
 
Thread Tools
  #1  
Old June 10th, 2008, 07:44 AM
Head Dish Washer
 
Join Date: Dec 2006
Location: Canada
Posts: 517
Thanks: 1
Thanked 4 Times in 4 Posts
supanatral is on a distinguished road
copying folders in terminal

I'm trying to copy a folder in terminal with all the contents inside of it but when I use the -r option, it just copy's the files within the folder to the destination so it doesn't create a new folder in the destination, it just copy's the individual files there.

Also, some of these files may be corrupt but is there a way that it will notify you if it is corupt?
__________________
3G iPhone on Rogers network
20" iMac 1.83GHz Intel Core Duo w/1.5GB of ram
15" Macbook Pro 2.2GHz Intel Core 2 Duo w/2GB of ram

-
In a world without walls and fences, who needs Windows and Gates?
Reply With Quote
  #2  
Old June 10th, 2008, 09:33 AM
ElDiabloConCaca's Avatar
U.S.D.A. Prime
 
Join Date: Aug 2001
Location: San Antonio, Texas
Posts: 9,905
Thanks: 2
Thanked 61 Times in 57 Posts
ElDiabloConCaca has a spectacular aura aboutElDiabloConCaca has a spectacular aura aboutElDiabloConCaca has a spectacular aura about
You should do this:

Code:
cp -r [source folder] [destination directory]/[foldername]/
Notice that you need to put the foldername in the destination as well. If the folder does not exist, it will be created. Also note the trailing slash.

The 'cp' command does not test for "corrupt" files, since files are nothing more than binary bits... how would a copy operation detect that a bit is supposed to be a 1 instead of a 0? "Corrupt" file could mean anything -- a PhotoShop file that has a 1px black line through it may be "corrupt" to you, but it's just a bunch of bits to the computer and the computer doesn't know that line isn't supposed to be there.
__________________
Power Macintosh G4/500MHz "Yikes!" 10.4.11 Server • 1024MB • 3 x 120GB + 320GB • DVR-111D • 2 x Radeon 7000 PCI • 2 x 17" CRT
MacBook 2.0GHz Core 2 Duo - White 10.5.5 • 2048MB • 80GB • CD-RW/DVD-ROM
iPod Photo 60GB • iPod nano 1GB • AT&T DSL 6Mb/768k
http://www.jeffhoppe.com
Reply With Quote
  #3  
Old June 10th, 2008, 09:36 AM
Head Dish Washer
 
Join Date: Dec 2006
Location: Canada
Posts: 517
Thanks: 1
Thanked 4 Times in 4 Posts
supanatral is on a distinguished road
Ok, well that makes sense, very good point. Thanks for your help
__________________
3G iPhone on Rogers network
20" iMac 1.83GHz Intel Core Duo w/1.5GB of ram
15" Macbook Pro 2.2GHz Intel Core 2 Duo w/2GB of ram

-
In a world without walls and fences, who needs Windows and Gates?
Reply With Quote
  #4  
Old June 10th, 2008, 11:12 AM
Head Dish Washer
 
Join Date: Dec 2006
Location: Canada
Posts: 517
Thanks: 1
Thanked 4 Times in 4 Posts
supanatral is on a distinguished road
One last question about copying files. If I login to the mac remotely using SSH and start copying files, does it continue to copy after I log out of SSH?
__________________
3G iPhone on Rogers network
20" iMac 1.83GHz Intel Core Duo w/1.5GB of ram
15" Macbook Pro 2.2GHz Intel Core 2 Duo w/2GB of ram

-
In a world without walls and fences, who needs Windows and Gates?
Reply With Quote
  #5  
Old June 10th, 2008, 11:17 AM
ElDiabloConCaca's Avatar
U.S.D.A. Prime
 
Join Date: Aug 2001
Location: San Antonio, Texas
Posts: 9,905
Thanks: 2
Thanked 61 Times in 57 Posts
ElDiabloConCaca has a spectacular aura aboutElDiabloConCaca has a spectacular aura aboutElDiabloConCaca has a spectacular aura about
Nope, unless you launch the process as a background process.
__________________
Power Macintosh G4/500MHz "Yikes!" 10.4.11 Server • 1024MB • 3 x 120GB + 320GB • DVR-111D • 2 x Radeon 7000 PCI • 2 x 17" CRT
MacBook 2.0GHz Core 2 Duo - White 10.5.5 • 2048MB • 80GB • CD-RW/DVD-ROM
iPod Photo 60GB • iPod nano 1GB • AT&T DSL 6Mb/768k
http://www.jeffhoppe.com
Reply With Quote
  #6  
Old June 10th, 2008, 11:32 AM
Head Dish Washer
 
Join Date: Dec 2006
Location: Canada
Posts: 517
Thanks: 1
Thanked 4 Times in 4 Posts
supanatral is on a distinguished road
First of all I need to say: Man I love this site! I get much more qualified people to answer my questions then even AppleCare and I get a answer sooner then AppleCare because of the usual wait time.

How can I make it a background process?
__________________
3G iPhone on Rogers network
20" iMac 1.83GHz Intel Core Duo w/1.5GB of ram
15" Macbook Pro 2.2GHz Intel Core 2 Duo w/2GB of ram

-
In a world without walls and fences, who needs Windows and Gates?
Reply With Quote
  #7  
Old June 10th, 2008, 11:59 AM
wraith's Avatar
Rock Dork
 
Join Date: Jan 2003
Location: NC, USA
Posts: 89
Thanks: 0
Thanked 0 Times in 0 Posts
wraith is on a distinguished road
You can put a "&" at the end of the command.

ie: cp * /stuff &

to bring it back to the foreground, type "fg"
__________________
Matt
400Mhz G4 PowerMac
867Mhz G4 Powerbook
1.0 Ghz G4 eMac
2.0 Ghz Intel Duo MacBook
Reply With Quote
  #8  
Old June 10th, 2008, 01:01 PM
Viro's Avatar
Registered User
 
Join Date: Nov 2003
Location: Oxford, UK
Posts: 2,489
Thanks: 0
Thanked 1 Time in 1 Post
Viro will become famous soon enoughViro will become famous soon enough
Quote:
Originally Posted by wraith View Post
You can put a "&" at the end of the command.

ie: cp * /stuff &

to bring it back to the foreground, type "fg"
As far as I know, that will not work if you log out of SSH before the copy is complete.
Reply With Quote
Reply

Thread Tools

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump


All times are GMT -5. The time now is 07:50 PM.


Mac Support® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2000-2008 DigitalCrowd, Inc.