LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-05-2005, 02:51 PM   #1
freakin'me
Member
 
Registered: Aug 2005
Distribution: Debian Sarge
Posts: 31

Rep: Reputation: 15
Changing the (what is it called?)


Hi,

I just set up a debian (sarge) box, and now after every time I log in,ever line starts with:

Quote:
65:~#
I want to change this, how should I do this? (sorry, but I don't know what it is called)

Regards,

Freakin'me
 
Old 10-05-2005, 02:57 PM   #2
SirSlappy
Member
 
Registered: Jun 2003
Location: Glendale AZ
Distribution: Slackware 10
Posts: 153

Rep: Reputation: 30
hostname

hostname

/etc/hostname
 
Old 10-05-2005, 03:02 PM   #3
freakin'me
Member
 
Registered: Aug 2005
Distribution: Debian Sarge
Posts: 31

Original Poster
Rep: Reputation: 15
Thanks for your quick reply.

However, when I enter /etc/hostname, the only thing I see is "debian". I used this tutorial to set everything up: http://www.falkotimme.com/howtos/per...arge/index.php , I think one of the software has changed something, but I don't know what it was/is.

Regards,

Freakin'me

Last edited by freakin'me; 10-05-2005 at 03:06 PM.
 
Old 10-05-2005, 03:12 PM   #4
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
I think you're after the "prompt."

If that is the case, then an environment variable needs to be changed/modified/updated. The actual name of the environment variable depends on the shell you use. For bash, it's PS1. For tcsh, I believe it's prompt. I'm not sure what other shells use (such as ksh, zsh, etc). Bash is popular, so I'll assume you have that one.

You can experiment with new prompts directly at the command line. For example:
Code:
export PS1='\u@\h:\w\$'
Executing that command (in the bash shell) will make the prompt be: <user name>@<hostname>:<working directory>($|#)

THe '$' or '#' at the end of the prompt indicates whether the user is a regular user or root; only root sees the '#' at the end.

The prompt may look like this after the change:
Code:
chris@deimos:~$
There are many different codes you can embed in the prompt with different information. Each shell is different in how you specify what information to display, and what information is available to display. You'll need to pull up the man page for your shell and read up on it. If you're using bash, it's located under the section titled "PROMPTING."

EDIT:
Forgot to mention, to make the change permanent, the export line above either needs to be put in /etc/profile or included in the user's ${HOME}/.bash_profile.

Last edited by Dark_Helmet; 10-05-2005 at 03:16 PM.
 
Old 10-05-2005, 03:22 PM   #5
freakin'me
Member
 
Registered: Aug 2005
Distribution: Debian Sarge
Posts: 31

Original Poster
Rep: Reputation: 15
Thank you, that's exactly what I was looking for. However: My prompt is now: root@65.98.38.210:/etc/networking#

How do I change the 65.98.38.210 into serverdownstairs.lan?

Regards,

Freakin'me
 
Old 10-05-2005, 03:31 PM   #6
freakin'me
Member
 
Registered: Aug 2005
Distribution: Debian Sarge
Posts: 31

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by Dark_Helmet EDIT:
Forgot to mention, to make the change permanent, the export line above either needs to be put in /etc/profile or included in the user's ${HOME}/.bash_profile. [/B]
And what if I want to apply this to all users, and all new users? (Yes, I'm sorry, quite a n00b)
 
Old 10-05-2005, 03:35 PM   #7
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
## Hostname stuff
I don't use debian, so I can only make educated guesses. The man page for bash says the '\h' code gets "the hostname up to the first `.'"

For this one, SirSlappy was right on the mark. Use the hostname command to change your hostname, or put the desired hostname in /etc/hostname.

If that doesn't work, then you may need to look at the documentation for system startup to find how the hostname is set. Some distributions (like Red Hat) will keep the desired hostname in a different file, and execute "hostname <contents of other file>" on boot. Debian might do something similar.

## Global/personal prompt
Applying to all users is done by adding it to /etc/profile. That file is automatically read by bash when it starts up. It gives the administrator the opportunity to set up default settings (such as the prompt). The ${HOME}/.bash_profile is user specific. Keep in mind, you can't force users to use the prompt. They can override it with their own version in their personal .bash_profile.

Last edited by Dark_Helmet; 10-05-2005 at 03:37 PM.
 
Old 10-05-2005, 03:38 PM   #8
freakin'me
Member
 
Registered: Aug 2005
Distribution: Debian Sarge
Posts: 31

Original Poster
Rep: Reputation: 15
Thanks for your reply.

My /etc/hostnames still contains nothing but "debian", so anybody who knows where debian (sarge) stores the hostname stuff?
 
Old 10-06-2005, 04:00 AM   #9
freakin'me
Member
 
Registered: Aug 2005
Distribution: Debian Sarge
Posts: 31

Original Poster
Rep: Reputation: 15
After a reboot my prompt is again just debian$: or something like that. However, when I boot, postfix gives an error about the fact that 65.98.38.210 is a numeric hostname.....

I can remember that I got during the installation of postfix a notice that the hostname I'd use for postfix whould also be used for other apps.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
acpi_power_off called TuxFreak Fedora 4 06-06-2005 09:27 AM
~/.xinitrc not called dvm Slackware 3 05-04-2005 02:49 AM
What are these called and where to get?? TippyToes Linux - Software 2 01-20-2005 03:38 PM
Called name not present? Pyroknight Linux - Networking 3 06-16-2003 04:17 AM
what's this called? ph33r Linux - General 1 04-19-2002 11:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:45 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