LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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: 539

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


as titled.
 
Old 03-28-2014, 11:21 AM   #2
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,326

Rep: Reputation: 919Reputation: 919Reputation: 919Reputation: 919Reputation: 919Reputation: 919Reputation: 919Reputation: 919
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: 539

Original Poster
Rep: Reputation: 33
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 Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 23,216

Rep: Reputation: 7685Reputation: 7685Reputation: 7685Reputation: 7685Reputation: 7685Reputation: 7685Reputation: 7685Reputation: 7685Reputation: 7685Reputation: 7685Reputation: 7685
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: 26,339

Rep: Reputation: 6146Reputation: 6146Reputation: 6146Reputation: 6146Reputation: 6146Reputation: 6146Reputation: 6146Reputation: 6146Reputation: 6146Reputation: 6146Reputation: 6146
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 Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:43 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
Open Source Consulting | Domain Registration