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 10-05-2009, 06:23 AM   #1
mohitdaksh
Member
 
Registered: Oct 2009
Posts: 50

Rep: Reputation: 18
Moving files from one account to other


I have some files on my root account which I want on my other non-root account.

Is there a way to copy files from my root account to my non-root account and vice versa. I am using FC 7.
 
Old 10-05-2009, 06:29 AM   #2
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
Sure we got the cp command to copy things. use it with the -a option to have all the permissions remain the same. Else the umask would jump in place.
Or use the mv command which moves things. Like copy and delete in one go. You would not need the -a options (dunno if mv even has one).
*edit*
Ups forget to chown the files so the user has acces to the files
Code:
chown otheruser:otherusersgroup ~otheruser -R
*edit end*

In Desktop enviroment this could be difficult cause you normaly would need root to access the root owned files.
Maybe acl's could work.

If you just need two directory to be the same wether its the root or the other user you might want to look into syncing the dirs. Maybe with rsync. run the syncing in a hourly cron job if that suits.

Last edited by zhjim; 10-05-2009 at 06:30 AM.
 
Old 10-05-2009, 06:30 AM   #3
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
If you want to copy from the root account:
as root:
Code:
cp files-you-want-to-copy /home/user
chown -R user:user /home/user/
 
Old 10-05-2009, 06:32 AM   #4
mohitdaksh
Member
 
Registered: Oct 2009
Posts: 50

Original Poster
Rep: Reputation: 18
Thanks a lot for your help. I'll try it out
 
Old 10-05-2009, 06:35 AM   #5
mohitdaksh
Member
 
Registered: Oct 2009
Posts: 50

Original Poster
Rep: Reputation: 18
Quote:
Originally Posted by repo View Post
If you want to copy from the root account:
as root:
Code:
cp files-you-want-to-copy /home/user
chown -R user:user /home/user/

There are a lot of files that I want to copy. Is there a way so that all the files in a particular directory get copied?
 
Old 10-05-2009, 06:41 AM   #6
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Quote:
There are a lot of files that I want to copy. Is there a way so that all the files in a particular directory get copied?
Code:
cp -R directoryname/ /home/user/
 
Old 10-05-2009, 07:01 AM   #7
mohitdaksh
Member
 
Registered: Oct 2009
Posts: 50

Original Poster
Rep: Reputation: 18
Everything got copied... Thanks a lot
 
  


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 files from a location to other, preventing to move incomplete files pogo123 Programming 8 11-14-2008 06:21 AM
moving files from a location to other, preventing to move incomplete files pogo123 Linux - Newbie 2 11-13-2008 01:57 PM
is it legitimate and allowed and can be done to make another user account set uid and gid to null 0 to make another root account with different name and possibly not damage the debian system creating and using that new account BenJoBoy Linux - Newbie 12 01-29-2006 10:02 AM
Moving files UmneyDurak Fedora 4 08-28-2005 05:52 PM
Moving user account info to a new server - advice please. Seventh Linux - Newbie 2 03-09-2005 09:38 AM

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

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