Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 03-25-2003, 05:57 AM   #1
LQ Newbie
Registered: Mar 2003
Distribution: mandrake 9
Posts: 2

Rep: Reputation: 0
small problem please help me

when i start up a console it comes up with [shadow@localhost]$
is there anyway i can change the local host part and call it something else.
Old 03-25-2003, 07:09 AM   #2
Senior Member
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Rep: Reputation: 57
You want to edit the .bashrc file in shadow's home directory(/home/shadow/.bashrc). Add the following to the end of the .bashrc file:

PS1='[\u in \w]\$ '
export PS1

Everything in between the ' ' is what shows up in the console. The \u stands for user and the \w stands for working directory(I think). Anyway this will show [shadow in ~]$ as your prompt.

There are many more switches available. Do a google search to find out more if you'd like.

You must restart the console for these changes to take effect.
Old 03-25-2003, 10:33 AM   #3
LQ Newbie
Registered: Mar 2003
Location: Utah, USA
Distribution: Red Hat / Mandrake
Posts: 4

Rep: Reputation: 0
If you want to just change the 'localhost" part change your computers host name. You can do this by changing the HOSTNAME variable in the /etc/sysconfig/network file.
Old 03-25-2003, 06:18 PM   #4
LQ Newbie
Registered: Mar 2003
Distribution: mandrake 9
Posts: 2

Original Poster
Rep: Reputation: 0
Thank you so much every thing is fine now.
Old 03-25-2003, 08:26 PM   #5
Registered: Feb 2003
Distribution: Debian
Posts: 797

Rep: Reputation: 30
You must restart the console for these changes to take effect.
well actually, you could just export PS1 on the command line. Or if you edited .bashrc, running 'bash' should do the job.

BTW, BASH(1) would have given you all the switches.


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
gkrellm small problem axelmang Linux - Software 1 11-19-2004 05:26 AM
Small Problem Saudm89 Mandriva 2 09-11-2004 07:51 PM
A small problem in C indian Programming 2 09-07-2004 09:56 AM
small problem s9722 Linux - Newbie 4 06-05-2003 08:13 PM
this problem is so small destkid Linux - Newbie 3 10-19-2001 10:39 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:59 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration