LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   mv user01 files & preferences to user02-- quick how (https://www.linuxquestions.org/questions/linux-newbie-8/mv-user01-files-and-preferences-to-user02-quick-how-570712/)

linexnal 07-19-2007 11:08 AM

mv user01 files & preferences to user02-- quick how
 
I created a new user 'user02' and am going to delete the old one 'user01' because today when I tired to login on the login screen, I couldn't. The screen turned black, after pressing enter, but then after a while it didn't go to the desktop, instead it went back to the login screen. Good thing root still worked so I made user02.

Are there a few simple steps to move user01 files & preferences to user02? I can't find anything through google mainly b/c there aren't any key words or phrases.

few simple steps... im new.. that means I don't know enough so don't assume I do

slakmagik 07-19-2007 11:13 AM

'cp -a /home/user01 /home/user02' should do. If the problem is a configuration error, that will just recreate it, though, and if it was a system-wide configuration error, you're likely to encounter it as any user. Good luck, though.

Oh, duh - a 'chown -R user02 /home/user02' as root might help, too.

linexnal 07-19-2007 11:27 AM

hey you know any _detailed_ articles I can read as a guide? I'm having problems.

Is it just a one-step process? And the system automatically does the rest? b/c it doesn't seem like a one-step process...

slakmagik 07-19-2007 11:44 AM

No, sorry, I don't know of any detailed articles, as it's not something that's done much, yet isn't especially complicated, AFAIK. What sort of problems are you having?

And I don't know what you mean by the last part. In answering 'Are there a few simple steps to move user01 files & preferences to user02?' I replied that the steps are to copy user01's files and dotfiles (files and preferences) to user02's $HOME. And then make sure they're all owned by user02 and then you should be done.

But, as I say, just deleting and then essentially recreating the account isn't likely to fix problems with that account. Since you say it "didn't go" to the desktop, I'm guessing you use a display manager and the problem is probably with that. If you log in to text mode, your virtual console should work fine. You might even be able to 'startx' and have X work fine if it's exclusively a display manager problem and not a general X problem. Which goes back to why I was saying it isn't something that's done often - your user01 account is probably generally fine and you'd be better off fixing the glitch than blowing out the whole account.

linexnal 07-19-2007 12:28 PM

Well.. during the process it asked if I wanted to overwrite ... so I just pressed enter since it didn't ask for a letter like y or n or anything.

After pressing many enters, the outcome is that there is a /home/user02/user02 which appears to have the same files as in /home/user02/. Is that suppose to happen...

The other thing is.. is it suppose to transfer the KDE preferences and other software preferences? like firefox's preferences..
b/c it appears like some of the KDE preferences were moved but some are missing..

"Since you say it "didn't go" to the desktop, I'm guessing you use a display manager and the problem is probably with that. If you log in to text mode, your virtual console should work fine."
No, I'm able to log in now onto the KDE desktop. I never log into text mode b/c then I'm at a black screen, I guess a type of shell.. but I couldn't do anything like open firefox for example.
"I'm guessing you use a display manager"
I don't know what that is. I just know I use the KDE environment.. so you start the computer > login > now at desktop

slakmagik 07-19-2007 01:00 PM

Quote:

Originally Posted by linexnal
Well.. during the process it asked if I wanted to overwrite ... so I just pressed enter since it didn't ask for a letter like y or n or anything.

After pressing many enters, the outcome is that there is a /home/user02/user02 which appears to have the same files. Is that suppose to happen...

Not sure what happened there. No, that shouldn't happen. The copying shouldn't be so much a 'process' as a single command with a single enter. True, though, if you'd already created the account it would've generated a /home/user02 and copied in the contents of /etc/skel so I should have told you to remove user02's home first before copying in user01's data in its place. That may have caused the 'overwrite' query, though that means your cp is aliased to 'cp -i'. Sorry there. Still not sure how it ended up creating that extra hierarchy. But at least an excess of files just means removing the redundancies, so no damage done.

Quote:

Originally Posted by linexnal
The other thing is.. is it suppose to transfer the KDE preferences and other software preferences? like firefox's preferences..
b/c it appears like some of the KDE preferences were moved but some are missing.

Well, your preferences for KDE are in ~/.kde and whatever other couple of directories they may put stuff in and your firefox preferences are in ~/.mozilla (or maybe ~/.firefox; I dunno because I don't use firefox) so if you copy those dotdirs, you get the prefs. All your prefs (that aren't inherited from system-wide defaults) are in dotfiles in your $HOME.

Quote:

Originally Posted by linexnal
"But, as I say, just deleting and then essentially recreating the account isn't likely to fix problems with that account. Since you say it "didn't go" to the desktop, I'm guessing you use a display manager and the problem is probably with that. If you log in to text mode, your virtual console should work fine."
No, I'm able to log in now onto the KDE desktop. I never log in to text mode b/c then I'm at a black screen, I guess a type of shell.. but I couldn't do anything like open firefox for example.
"I'm guessing you use a display manager"
I don't know what that is. I just know I use the KDE environment.. so you start the computer > login > now at desktop

Cool - surprised that cleared everything up, but that's good. Yeah, the text mode gives you your shell. You can run text mode browsers like lynx, but not graphical ones like firefox. As far as the display manager, I mean the graphical logon where you can type your name/password and select your 'session'. So that's an affirmative. :)

As far as straightening out the bit of a mess user02's $HOME might be in, you could use 'diff' (or probably a KDE GUI version) to check on the consistency of the directories. The reason to do a copy rather than a move is in case something went wrong (which it sounds like it sort of did), so you can do a 'diff /home/user01/.kde /home/user02/.kde' (and then apparently, a 'diff /home/user02/.kde /home/user02/user02/.kde) and so on and delete the redundancies. Make sure nothing's missing like you mentioned it might be, though it shouldn't be.


All times are GMT -5. The time now is 10:41 AM.