LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 07-17-2013, 04:07 AM   #1
NotAComputerGuy
Member
 
Registered: Jun 2012
Distribution: Linux Mint - Debian Edition
Posts: 349

Rep: Reputation: 13
Change Default Home Directory Location


Hi,

Apologies if I'm not using the right terminology here, I'm guessing that's why I'm not getting the solution I want when I search for this question.

I'm using a pi with an attached hard drive. What I'd like to do is when I SSH in, rather than find myself in /home/pi, find myself in /media/hdd, as there's where I find everything I use and rarely use /home/pi.

I do not want to move /home/pi at all, I still need it for all my config files.

Thanks
 
Old 07-17-2013, 04:47 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,286

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
I would compromise by running the following line (in /home/pi)

Code:
ln -s /media/hdd  .
then /home/pi is the home directory, with config files. /home/pi/hdd is /media/hdd, and you don't have to fiddle with anything.

If you really want /media/hdd as the home dir, you would hit problems if ever the pi came up and /media/hdd wasn't there. You can do that sore of thing to yourself with usermod (man usermod) but what I'm suggesting is safer. This way, if the disk isn't there, it's a "no such file or directory" error.
 
1 members found this post helpful.
Old 07-17-2013, 04:53 AM   #3
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,281

Rep: Reputation: 320Reputation: 320Reputation: 320Reputation: 320
You can execute custom script after login, to change your working directory, for example inside "~/.profile" or "~/.bashrc". Just add
Code:
cd /media/hdd
at end.

Last edited by eSelix; 07-17-2013 at 04:57 AM.
 
1 members found this post helpful.
Old 07-17-2013, 04:55 AM   #4
NotAComputerGuy
Member
 
Registered: Jun 2012
Distribution: Linux Mint - Debian Edition
Posts: 349

Original Poster
Rep: Reputation: 13
Thank you for highlighting potential problems and presenting a safe, simple and elegant solution, whilst also presenting the solution to my original question if I felt like taking a risk!
 
Old 07-17-2013, 06:22 AM   #5
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,286

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Sounds like you're happy - great :-). That was quick. Mark it solved and carry omn.
 
  


Reply



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] Change Default Home Directory for Ldap User sunveer Linux - Newbie 1 08-14-2012 11:27 PM
[SOLVED] How can i change my HOME (/home/user) directory location to something else? QueenZ Linux - Newbie 6 08-05-2010 06:26 AM
Change Default Home Directory with LDAP and Automount greslore Linux - General 3 06-23-2009 03:32 PM
how to change location of /home? mark_2811 Linux - General 4 01-23-2004 06:19 AM
changing user's default ftp home location GraemeK Linux - Networking 0 12-31-2003 12:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:27 PM.

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