LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-28-2014, 11:18 AM   #1
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 537

Rep: Reputation: 32
How to get the 'user.home' and 'user.dir' with a Linux command?


as titled.
 
Old 03-28-2014, 11:21 AM   #2
schneidz
Senior Member
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 4,831

Rep: Reputation: 812Reputation: 812Reputation: 812Reputation: 812Reputation: 812Reputation: 812Reputation: 812
this question doesnt make much sense but i will assume you mean the users home directory:
Code:
[schneidz@hyper ebay]$ echo $HOME
/home/schneidz
if those are specific files you can just cat them
Code:
[schneidz@hyper ebay]$ touch user.home user.dir
[schneidz@hyper ebay]$ find $HOME -name user.home -o -name user.dir
/home/schneidz/ebay/user.dir
/home/schneidz/ebay/user.home
[schneidz@hyper ebay]$ cat user.home user.dir

Last edited by schneidz; 03-28-2014 at 11:26 AM.
 
Old 03-31-2014, 07:23 AM   #3
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 537

Original Poster
Rep: Reputation: 32
This is not what I want. What I want is: I log in to machine and want to know where is my user.home.
 
Old 03-31-2014, 07:45 AM   #4
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 6,990

Rep: Reputation: 1877Reputation: 1877Reputation: 1877Reputation: 1877Reputation: 1877Reputation: 1877Reputation: 1877Reputation: 1877Reputation: 1877Reputation: 1877Reputation: 1877
that is exactly echo $HOME. But actually these expressions (user.home and user.dir) are not general terms in the linux world. Therefore you need to explain what do you really mean by them.
 
Old 03-31-2014, 09:16 AM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 13,684

Rep: Reputation: 1164Reputation: 1164Reputation: 1164Reputation: 1164Reputation: 1164Reputation: 1164Reputation: 1164Reputation: 1164Reputation: 1164
Well, then what do you want? What distribution / version are you currently running?

As stated you need to define what you mean by "where is my use.home". I will try to guess and say you want to know what partition /home resides. You can look at the output of the mount command as well as looking at the /etc/fstab file. If /home is not shown then it is part of your / partition.
 
Old 03-31-2014, 12:10 PM   #6
Habitual
LQ Addict
 
Registered: Jan 2011
Location: Youngstown, Ohio
Distribution: LM 17.1
Posts: 5,526
Blog Entries: 10

Rep: Reputation: 1357Reputation: 1357Reputation: 1357Reputation: 1357Reputation: 1357Reputation: 1357Reputation: 1357Reputation: 1357Reputation: 1357Reputation: 1357
Quote:
Originally Posted by thomas2004ch View Post
This is not what I want. What I want is: I log in to machine and want to know where is my user.home.

Then use something a little more than
Quote:
Originally Posted by thomas2004ch View Post
as titled.
You get out of it what you put into it.
 
  


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
[SOLVED] Create the new userís home dir in /home thiyagusham Linux - Newbie 8 01-14-2013 05:34 PM
Lock user in home dir JJX Linux - General 9 06-28-2011 03:09 PM
user home dir doesn't create when new user add dev_mohamed Linux - Software 3 01-12-2007 02:08 AM
user home dir/permissions xilace Linux - Security 5 07-21-2004 01:33 PM
recover user and home dir powadha Linux - General 5 04-16-2004 10:08 AM


All times are GMT -5. The time now is 06:33 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration