Show the full path in the command line

hi

I'm conneting to my freeBSD 7.0 using putty.
Howto configure to show the full path in the command line?
 
[cmd=]pwd[/cmd]

If you use tcsh here's a nice addition to ~/.cshrc:
Code:
switch($TERM)
        case "xterm*":
                setenv TITLE "%{\033]0;%n@%m:%~\007%}"
                breaksw
        default:
                setenv TITLE ""
                breaksw
endsw

Then change the set prompt to:
Code:
set prompt = "${TITLE}%n@%m:%~%#"

That will show the current directory in the prompt and in putty's title bar.
 
I know less about bash than you know about chicken friend bacon.

From tcsh(1)
%/ The current working directory.
%~ The current working directory, but with one's home direc-
tory represented by `~' and other users' home directories
represented by `~user' as per Filename substitution.
`~user' substitution happens only if the shell has already
used `~user' in a pathname in the current session.
So something like % echo "set prompt = '%/ %# '" >> .cshrc should do it for tcsh.

I don't know about bash or zsh or ksh, sorry.
 
stevejones said:
Install bash.

Doesn't bash show 'user@host path' as default ?

Why? T/CSH works perfectly. Why waste base system resources just to see prompt? Oh and by default it does not show user@hostname. Under Linux distro configure PS1 like that..
 
The bash port does show 'user@host path' by default nowadays, no settings needed.
 
Thanks for the question, and answers. I didn't even realize what shell I was using (oops!) but just put the appropriate line in my .cshrc file. I had meant to look at that for a while. What I'd really like is to also make the line a different colour like red. How hard is that?
 
Try something like this and fit to your liking:
Code:
set prompt = "%B%n@%m%b %{\033[35;1m%}%l%{\033[m%} [%{\033[36;1m%}%c04%{\033[m%}]: "

The colors are expressed as standard ANSI color escape sequences, so they will probably not work on non ANSI terminals.

[CMD=]\033[3Xm[/CMD] - Sets the text foreground color
[CMD=]\033[4Xm[/CMD] - Sets the text background color

Where 'X' is one of:

0 - black
1 - red
2 - green
3 - yellow
4 - blue
5 - magenta
6 - cyan
7 - white

[CMD=]\033[m[/CMD] - Turns off all text attributes

Multiple attributes may be combined by use of a semicolon ';'. i.e. to set red background and white text:

[CMD=]\033[41;37m[/CMD]
 
mickey said:
Try something like this and fit to your liking:
Code:
set prompt = "%B%n@%m%b %{\033[35;1m%}%l%{\033[m%} [%{\033[36;1m%}%c04%{\033[m%}]: "

The colors are expressed as standard ANSI color escape sequences, so they will probably not work on non ANSI terminals.

[CMD=]\033[3Xm[/CMD] - Sets the text foreground color
[CMD=]\033[4Xm[/CMD] - Sets the text background color

Where 'X' is one of:

0 - black
1 - red
2 - green
3 - yellow
4 - blue
5 - magenta
6 - cyan
7 - white

[CMD=]\033[m[/CMD] - Turns off all text attributes

Multiple attributes may be combined by use of a semicolon ';'. i.e. to set red background and white text:

[CMD=]\033[41;37m[/CMD]

Here's a longer list, if anyone is interested:
http://ascii-table.com/ansi-escape-sequences.php
http://ascii-table.com/ansi-escape-sequences-vt-100.php

I found this precious info when I was writing asm in FreeBSD for university :)
 
Back
Top