LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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 11-08-2012, 09:26 PM   #1
abhi7514
LQ Newbie
 
Registered: Sep 2012
Posts: 5

Rep: Reputation: Disabled
Question Linux user location/directoires


Hi,
I need to create a user. I know it sounds simple but I'm having a slight issue with it. For example I want to create user1 with home location of /home/projects/user1. I went ahead and created the projects directory using mkdir under /home, and also user1 directory under /projects, but whenever I use the ls -l command to check the structure, the user1 shows under home and nothing under /home. I'm not sure What I'm doing wrong.

Also if I wanted to create a directory under user1, should I simply type: mkdir /home/projects/user1/usrdir ??? Is there a better or simpler way?

I still a newbie, so please if anyone could point me at the right direction, I would really appreciate it.

Thanks in advance.

Last edited by abhi7514; 11-08-2012 at 11:38 PM.
 
Old 11-08-2012, 09:42 PM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,524
Blog Entries: 27

Rep: Reputation: 1175Reputation: 1175Reputation: 1175Reputation: 1175Reputation: 1175Reputation: 1175Reputation: 1175Reputation: 1175Reputation: 1175
Is the desired home directory /home/projects/user1 or /projects/user1?

How did you use vi to create /projects/user1?

What is the output of tree -d -L 1 / and tree -d -L 1 /home ?

Yes, mkdir /home/projects/user1/usrdir is a good way to create that directory, best done as user1 to get the right ownerships. Alternatively you could do it using a graphical file manager.

Last edited by catkin; 11-08-2012 at 09:43 PM.
 
Old 11-08-2012, 09:52 PM   #3
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-14.1 on a Lenovo T61 6457-4XG
Posts: 3,970

Rep: Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936
Let's say you begin with only the /home directory and didn't yet create /home/projects nor its sub-directories

Let me quote "man mkdir":
Code:
NAME
       mkdir - make directories

SYNOPSIS
       mkdir [OPTION]... DIRECTORY...

DESCRIPTION
       Create the DIRECTORY(ies), if they do not already exist.

       Mandatory arguments to long options are mandatory for short options too.

       -m, --mode=MODE
              set file mode (as in chmod), not a=rwx - umask

       -p, --parents
              no error if existing, make parent directories as needed
So I would simply type:
Code:
mkdir -p /home/projects/user1/usrdir
It would help if you say which distribution you use as some provide specific commands that can be handy.
 
Old 11-08-2012, 11:42 PM   #4
abhi7514
LQ Newbie
 
Registered: Sep 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
Sorry for the typo, and thanks

Sorry for the typo, I had vi in my mind at the time I typed the question. I think I figured out most of it. in fedora linux, whenever you create a new user, it by default puts it under the /home directory. Everything made sense after that. Thanks guys for your input. I appreciate it.
 
Old 11-09-2012, 01:07 AM   #5
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-14.1 on a Lenovo T61 6457-4XG
Posts: 3,970

Rep: Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936
Quote:
Originally Posted by abhi7514 View Post
in fedora linux, whenever you create a new user, it by default puts it under the /home directory.
That is the case in any Linux distribution which uses the "useradd" command either directly or through a wrapper script or a graphical interface, see "man useradd".
 
  


Reply

Tags
directory, linux, location, user


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
gedit user dictionary location S. Chapelin Linux - Newbie 11 12-14-2011 01:26 AM
proftpd User Upload Location Chryzmo Slackware 1 05-05-2004 09:34 PM
Changing flags only for directoires ivanatora Linux - General 3 10-14-2003 05:28 AM
problem accessing directoires on cdrom u998r3s Linux - General 4 03-12-2002 12:17 AM


All times are GMT -5. The time now is 11:00 PM.

Main Menu
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