Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 08-04-2004, 09:21 PM   #1
Registered: Jun 2004
Posts: 256

Rep: Reputation: 30
linux prompt(really newbie question)

my prompt have
root@localhost dirname>

how do I change the "localhost" to some other name?
Old 08-04-2004, 09:25 PM   #2
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911
depends on distro, often by editing /etc/HOSTNAME

Old 08-04-2004, 09:26 PM   #3
Senior Member
Registered: Aug 2003
Location: Upstate
Distribution: Debian, Mint, Mythbuntu
Posts: 1,241

Rep: Reputation: 77
Become root by typing "su" and entering the password, then type:
hostname newname
where newname is the name you want your computer to have
Old 08-04-2004, 10:30 PM   #4
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
Note that using the hostname command the prompt won't be updated right away. Also, you'll need to put the command into your rc.local file or its moral equivalent to keep it accross reboots.
Old 08-04-2004, 10:34 PM   #5
Registered: Jun 2004
Posts: 256

Original Poster
Rep: Reputation: 30
For redhat 9, the file is stored in /etc/sysconfig/network

When I install redhat 9. The default hostname is "localhost.localdomain"

but my display only shows "root@localhost directory"

why didn't it show "root@localhost.localdomain directory"
Old 08-05-2004, 12:37 AM   #6
LQ Newbie
Registered: Aug 2004
Location: Gold Coast, Queensland, Australia
Distribution: SuSe 9.1
Posts: 10

Rep: Reputation: 0
Because "Localhost" is your actuall box's name and "localdomain" is the domain you box is on...

So the domain your on, isn't the name of your linux box

it's like my box... my doamin name, but my box name is Susan (coz i'm running Suse 9.1) so mine displays "Susan:/ #" coz susan's my box name

hope that clear's things up a bit



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
Linux newbie question ki11.viru5 Ubuntu 2 11-14-2005 10:36 PM
Linux newbie question..sorry scheung SUSE / openSUSE 1 10-17-2005 09:37 PM
Linux Newbie Question eckertc1 Linux - General 3 03-03-2005 08:16 PM
login prompt question & kde scheme question JustinCoyan Slackware 2 06-09-2004 02:02 PM
$prompt (newbie question) wogga Linux - Software 7 05-31-2004 03:53 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:51 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration