Originally Posted by rock18
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.
1)-[root@server ora]# pwd
2)-[root@server ora]# du -sh .
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.
4)-[root@server ora]# finger ora
Login: ora Name: (null)
Directory: /new/ora Shell: /bin/bash
Never logged in.
5)-[root@server ora]# ls -l
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".