Quantcast

rename home directory

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

rename home directory

Saikat Saha-2
Hi,

Can anybody tell me how to rename Home Directory in Ubuntu 11.04?


Regards,
Saikat Saha

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: rename home directory

Md Ashickur Rahman Noor
You mean you want to rename /home/some_name ??
----------------------------------------------------------
Dedicated Linux Forum in Bangladesh
2048R/89C932E1
Volunteer
, FOSS Bangladesh && Mozilla Reps
01199151550




On 12 March 2012 19:21, Saikat Saha <[hidden email]> wrote:
Hi,

Can anybody tell me how to rename Home Directory in Ubuntu 11.04?


Regards,
Saikat Saha

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: rename home directory

Colin Law-4
In reply to this post by Saikat Saha-2
On 12 March 2012 13:21, Saikat Saha <[hidden email]> wrote:
> Hi,
>
> Can anybody tell me how to rename Home Directory in Ubuntu 11.04?

Do you mean rename the directory /home or rename the home directory of
a particular user, or make it so that a particular user uses a
different directory to the one he currently uses?

Colin

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: rename home directory

Alexander Skwar (ML)
In reply to this post by Saikat Saha-2
Am 12.03.2012 14:21, schrieb Saikat Saha:
> Hi,
>
> Can anybody tell me how to rename Home Directory in Ubuntu 11.04?

mv
or: usermod

But I would not recommend to do this. There might be just so many
applications installed with user configuration files in $HOME, which
have a full pathname in some configuration setting.

If you'd now change the $HOME directory for "user1" from /home/user1
to /home/1-user, these applications might have problems, as they
reference "/home/user1".

Regards,




Alexander
--
☄ Google+ ↣ http://plus.skwar.me                   ☄
☛ Lifestream (Twitter, …) ↣ http://sup.skwar.me    ☛
⚰ Twitter: @alexs77 ↣ http://twitter.com/alexs77   ⚰
☞ Chat (Jabber/Google Talk) ↣ [hidden email]    ☞

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: rename home directory

Saikat Saha-2
Hi,

i want to rename "/Home/username" this folder only.

~Saikat

On Mon, Mar 12, 2012 at 6:57 PM, Alexander Skwar (ML)
<[hidden email]> wrote:

> Am 12.03.2012 14:21, schrieb Saikat Saha:
>
>> Hi,
>>
>> Can anybody tell me how to rename Home Directory in Ubuntu 11.04?
>
>
> mv
> or: usermod
>
> But I would not recommend to do this. There might be just so many
> applications installed with user configuration files in $HOME, which
> have a full pathname in some configuration setting.
>
> If you'd now change the $HOME directory for "user1" from /home/user1
> to /home/1-user, these applications might have problems, as they
> reference "/home/user1".
>
> Regards,
>
>
>
>
> Alexander
> --
> ☄ Google+ ↣ http://plus.skwar.me                   ☄
> ☛ Lifestream (Twitter, …) ↣ http://sup.skwar.me    ☛
> ⚰ Twitter: @alexs77 ↣ http://twitter.com/alexs77   ⚰
> ☞ Chat (Jabber/Google Talk) ↣ [hidden email]    ☞
>
>
> --
> ubuntu-users mailing list
> [hidden email]
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: rename home directory

Alexander Skwar (ML)
Am 12.03.2012 14:31, schrieb Saikat Saha:
> Hi,
>
> i want to rename "/Home/username" this folder only.

usermod -d

from man usermod:

        -d, --home HOME_DIR
            The user's new login directory.

            If the -m option is given, the contents of the current home
            directory will be moved to the new home directory, which is
created
            if it does not already exist.


But, as I said, it might not work so well, because of applications,
which store path names in their configuration files.


Alexander
--
☄ Google+ ↣ http://plus.skwar.me                   ☄
☛ Lifestream (Twitter, …) ↣ http://sup.skwar.me    ☛
⚰ Twitter: @alexs77 ↣ http://twitter.com/alexs77   ⚰
☞ Chat (Jabber/Google Talk) ↣ [hidden email]    ☞

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: rename home directory

Brian-277
In reply to this post by Saikat Saha-2
On Mon 12 Mar 2012 at 19:01:13 +0530, Saikat Saha wrote:

> On Mon, Mar 12, 2012 at 6:57 PM, Alexander Skwar (ML)
> <[hidden email]> wrote:
> > Am 12.03.2012 14:21, schrieb Saikat Saha:
> >
> >> Hi,
> >>
> >> Can anybody tell me how to rename Home Directory in Ubuntu 11.04?
> >
> >
> > mv
> > or: usermod
> >
> > But I would not recommend to do this. There might be just so many
> > applications installed with user configuration files in $HOME, which
> > have a full pathname in some configuration setting.
> >
> > If you'd now change the $HOME directory for "user1" from /home/user1
> > to /home/1-user, these applications might have problems, as they
> > reference "/home/user1".

> i want to rename "/Home/username" this folder only.

Yes. You have said this twice. And it is the subject of your mail.

But it seems strange to want to do this so a reason might save people
from hunting in the dark.

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: rename home directory

Johnny Rosenberg
In reply to this post by Alexander Skwar (ML)
2012/3/12 Alexander Skwar (ML) <[hidden email]>:

> Am 12.03.2012 14:31, schrieb Saikat Saha:
>
>> Hi,
>>
>> i want to rename "/Home/username" this folder only.
>
>
> usermod -d
>
> from man usermod:
>
>       -d, --home HOME_DIR
>           The user's new login directory.
>
>           If the -m option is given, the contents of the current home
>           directory will be moved to the new home directory, which is
> created
>           if it does not already exist.
>
>
> But, as I said, it might not work so well, because of applications,
> which store path names in their configuration files.

And reinstalling those won't help? Or at least uninstalling and then
installing again?

I suppose that sed in some kind of loop could solve the problem
otherwise, couldn't it?



Kind regards

Johnny Rosenberg
ジョニー・ローゼンバーグ
>
>
>
> Alexander

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: rename home directory

William Scott Lockwood III
On Mon, Mar 12, 2012 at 3:58 PM, Johnny Rosenberg <[hidden email]> wrote:
>
> But, as I said, it might not work so well, because of applications,
> which store path names in their configuration files.

And reinstalling those won't help? Or at least uninstalling and then
installing again?

I suppose that sed in some kind of loop could solve the problem
otherwise, couldn't it?

You could grep (or rgrep) through the directory looking for configs that match the old directory name, and update them. Sounds dodgy. Why not just create a user with the new name, migrate your data over, and use that?

--
Regards,
W. Scott Lockwood

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: rename home directory

Amedee Van Gasse (ub)
In reply to this post by Saikat Saha-2
On 12-03-12 14:21, Saikat Saha wrote:
> Hi,
>
> Can anybody tell me how to rename Home Directory in Ubuntu 11.04?
>
Why do you want to do that?
If we know why, then we can tell you the best solution.

--
Amedee

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: rename home directory

Amedee Van Gasse (ub)
In reply to this post by Brian-277
On 12-03-12 21:25, Brian wrote:
> But it seems strange to want to do this so a reason might save people
> from hunting in the dark.

Excellent point. We should ask "why" more before we all jump in like
madmen trying to help someone. That would avoid a lot of duplicate and
conflicting answers.

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: rename home directory

Ric Moore
On 03/12/2012 05:48 PM, Amedee Van Gasse wrote:
> On 12-03-12 21:25, Brian wrote:
>> But it seems strange to want to do this so a reason might save people
>> from hunting in the dark.
>
> Excellent point. We should ask "why" more before we all jump in like
> madmen trying to help someone. That would avoid a lot of duplicate and
> conflicting answers.

Kinda like "What is 42?" You have to understand the nature of the answer
you seek in order to phrase the question properly. That is admittedly
tough when you're in the throes of a disaster though!


--
My father, Victor Moore (Vic) used to say:
"There are two Great Sins in the world...
..the Sin of Ignorance, and the Sin of Stupidity.
Only the former may be overcome." R.I.P. Dad.
http://linuxcounter.net/user/44256.html

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: rename home directory

Alexander Skwar (ML)
In reply to this post by Johnny Rosenberg
Am 12.03.2012 21:58, schrieb Johnny Rosenberg:

> 2012/3/12 Alexander Skwar (ML)<[hidden email]>:
>> Am 12.03.2012 14:31, schrieb Saikat Saha:
>>
>>> Hi,
>>>
>>> i want to rename "/Home/username" this folder only.
>>
>>
>> usermod -d
>>
>> from man usermod:
>>
>>        -d, --home HOME_DIR
>>            The user's new login directory.
>>
>>            If the -m option is given, the contents of the current home
>>            directory will be moved to the new home directory, which is
>> created
>>            if it does not already exist.
>>
>>
>> But, as I said, it might not work so well, because of applications,
>> which store path names in their configuration files.
>
> And reinstalling those won't help? Or at least uninstalling and then
> installing again?

It's not about *installation*. The installed programs will work just
fine.

It's rather about *configuration*. For example, Firefox or Thunderbird
used to store the full path name to the "profile" in some configuration
file. If you then changed the path, the profile couldn't be found.
(Note: I am not sure if it is still a problem with Firefox or
Thunderbird, but it might - and it might also affect other programs.)

> I suppose that sed in some kind of loop could solve the problem
> otherwise, couldn't it?

Sure. If you know what to change, it can be done. Something like this
might help out:

grep -rl "/home/old" /home/old > /home/old/files-with-home-old.txt

Then verify each file listed in /home/old/files-with-home-old.txt
and change /home/old to /home/new.

If you're confident about what's in /home/old/files-with-home-old.txt,
maybe after removing "wrong" files from the list, perl would be
handy:

while read home_old_file; do
  perl -pi -e 's,/home/old,/home/new,g' "$home_old_file"
done < /home/old/files-with-home-old.txt

Alexander
--
☄ Google+ ↣ http://plus.skwar.me                   ☄
☛ Lifestream (Twitter, …) ↣ http://sup.skwar.me    ☛
⚰ Twitter: @alexs77 ↣ http://twitter.com/alexs77   ⚰
☞ Chat (Jabber/Google Talk) ↣ [hidden email]    ☞

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Loading...