Changing the terminal host name from [localhost:~/]?

Gwailo

B.A. Economics (Hon)
How do I change the terminal name from localhost to something else? It looks rather strange to have it say localhost when I'm logged in remotely.

Thanks!
 
man tcsh

scroll to about 80% down the man page and you'll see a discussion of the various PROMPT tags you can use.

The default is [%m:%c3] %n%# where:

%m = hostname (localhost, in this case)
%c3 = current path (showing up to the last 3 directories)
%n = current username
%# = prompt char (usually > or # if root)

Change the prompt by issuing the command:

set prompt="<new prompt string>"

where <new prompt string> is the format you want to use. For example, if you want the time to be printed at each prompt:

set prompt="[%@] %#"

There's other tricks you can play as well, such as making strings bold, underlined, etc.

The good thing is it's all temporary, so if you really screw up, just close the terminal window and open a new one. When you find a combination you want to keep, add it to your ~/.tcshrc to install it each time you open a new shell.
 
I used to do lots of work on a machine running bash, like 3-4 years ago, Ièm vaguely remembering some of that now.

Excellent and concise reply, perhaps admin should make this a HOW-TO! :)

Cheers,
 
Back
Top