copying files between two accounts | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

copying files between two accounts

UNIX for Dummies Questions & Answers


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 02-06-2007
hinman hinman is offline
Registered User
 
Join Date: Feb 2007
Last Activity: 9 February 2007, 7:33 PM EST
Location: here
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
copying files between two accounts

I tried to copy all the files from an account directory to my account's directory

I did this command:

cp ~account1/direct/* ~myaccount/

the problem is that I did it twice, the first time there was a copy of some files, the seconde time there was a copy other files ? Which means the files were not the same...

Any ideas about the prob ?
Sponsored Links
    #2  
Old 02-06-2007
sb008 sb008 is offline Forum Advisor  
Registered User
 
Join Date: Jan 2007
Last Activity: 12 January 2013, 3:37 AM EST
Posts: 398
Thanks: 1
Thanked 3 Times in 3 Posts
The result of both copies should be the same umless something changed in the directory you are copying from.

Furthermore, in general it is not very wise to copy something from another directory directly into your home directory. You could overwrite valid files present in your home directory.

It is smarter to create an empty directory in your homedirectory and copy everything into that directory.

mkdir ~myaccount/colleaguedir
cp ~account1/direct/* ~myaccount/colleguedir

Also, you might not have sufficient rights to copy all files in the other directory.

Last but not least, subdirectories are not copied in this way. If you want those to be copied as well use:
cp -r ~account1/direct/* ~myaccount/colleguedir

Or even better:
cp -r ~account1/direct ~myaccount/colleguedir
This will include files starting with a . (DOT) present in ~account1/direct as well.
Sponsored Links
    #3  
Old 02-06-2007
hinman hinman is offline
Registered User
 
Join Date: Feb 2007
Last Activity: 9 February 2007, 7:33 PM EST
Location: here
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
I appreciate your help, thank you sir
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Files copying - [ Listed files alone. ] - Shell script linuxadmin Shell Programming and Scripting 4 07-31-2011 09:45 AM
copying of files by userB, dir & files owned by userA Hangman2 UNIX for Advanced & Expert Users 2 08-07-2009 12:41 PM
Copying Files user50210 Solaris 3 12-26-2008 06:29 AM
copying files tjay83 Shell Programming and Scripting 4 08-25-2008 12:52 PM



All times are GMT -4. The time now is 06:35 AM.