LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices



Reply
 
Search this Thread
Old 02-21-2013, 09:13 AM   #1
rock18
LQ Newbie
 
Registered: Aug 2012
Location: USA
Distribution: Redhat Linux,Solaris,Debian,Ubuntu
Posts: 4

Rep: Reputation: Disabled
User's Home Directory


Hi All,

I have RHEL 5.1 and i want to create a user with already exist Directory where i have some files and i am not getting user's deafult directory(.bashrc,.bash_history).

so please help i am new in Linux .

1)-[root@server ora]# pwd
/new/ora

2)-[root@server ora]# du -sh .
486M .

3)-[root@server ora]#useradd -m -d /new/ora ora
useradd: warning: the home directory already exists.
Not copying any file from skel directory into it.

4)-[root@server ora]# finger ora
Login: ora Name: (null)
Directory: /new/ora Shell: /bin/bash
Never logged in.
No mail.
No Plan.

5)-[root@server ora]# ls -l
total 4
drwxrwxrwx 2 root root 4096 Feb 21 14:15 DNS Tutorial


But no file related to this "ora" user.
 
Old 02-21-2013, 11:36 AM   #2
TB0ne
Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 15,088

Rep: Reputation: 2716Reputation: 2716Reputation: 2716Reputation: 2716Reputation: 2716Reputation: 2716Reputation: 2716Reputation: 2716Reputation: 2716Reputation: 2716Reputation: 2716
Quote:
Originally Posted by rock18 View Post
Hi All,
I have RHEL 5.1 and i want to create a user with already exist Directory where i have some files and i am not getting user's deafult directory(.bashrc,.bash_history). so please help i am new in Linux .
First, be aware that RHEL 5.1 is VERY old...the latest is 6.3, and that if you're using RHEL, you need to be paying for it. Things like this are well covered in Red Hat's knowledlegebase.
Quote:
1)-[root@server ora]# pwd
/new/ora
2)-[root@server ora]# du -sh .
486M .
3)-[root@server ora]#useradd -m -d /new/ora ora
useradd: warning: the home directory already exists.
Not copying any file from skel directory into it.
Since you're new to Linux, you need to read the man pages on commands. That alone will save you lots of time and headaches, since just typing in "man useradd" will tell you ALL the options, what they mean, and how they work. In the case of what you typed in, you're telling the system to use the /new/ora directory...and CREATE the /new/ora directory. Since it already exists, it can't be created, so it tells you that and fails. So, either remove the /new/ora directory, and let useradd create it, or omit the "-m" flag.

Chances are, you'll have to run the userdel command to remove the "ora" user first, since it already exists.
Quote:
4)-[root@server ora]# finger ora
Login: ora Name: (null)
Directory: /new/ora Shell: /bin/bash
Never logged in.
No mail.
No Plan.

5)-[root@server ora]# ls -l
total 4
drwxrwxrwx 2 root root 4096 Feb 21 14:15 DNS Tutorial
But no file related to this "ora" user.
Nope...again, it failed because of the already-existing directory, and the -m flag. Also, the man page on ls would help, since the command you entered, wouldn't show any hidden files. That's "ls -a".
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
User does int getting home directory in root home in ubuntu 10.04 lucid lynx sunrised24 Linux - Server 2 03-07-2012 10:21 AM
[SOLVED] 'Could not chdir to home directory /home/[user]: Permission denied' arashi256 Linux - Newbie 25 11-11-2011 10:29 AM
[SOLVED] How can i change my HOME (/home/user) directory location to something else? QueenZ Linux - Newbie 6 08-05-2010 07:26 AM
user's home directory on NFS server--what happens when user logs in from 2 computers? Mountain Linux - Networking 1 03-18-2009 04:35 PM
Active Directory User Cannot Write to Samba Home Directory jonwatson Linux - Networking 2 12-19-2006 01:40 PM


All times are GMT -5. The time now is 07:24 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration