# Show the full path in the command line



## ccc (Dec 20, 2009)

hi

I'm conneting to my freeBSD 7.0 using putty.
Howto configure to show the full path in the command line?


----------



## SirDice (Dec 20, 2009)

[cmd=]pwd[/cmd]

If you use tcsh here's a nice addition to ~/.cshrc:

```
switch($TERM)
        case "xterm*":
                setenv TITLE "%{\033]0;%n@%m:%~\007%}"
                breaksw
        default:
                setenv TITLE ""
                breaksw
endsw
```

Then change the set prompt to:

```
set prompt = "${TITLE}%n@%m:%~%#"
```

That will show the current directory in the prompt and in putty's title bar.


----------



## fronclynne (Dec 20, 2009)

*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.
> ...


So something like `%  echo "set prompt = '%/ %# '" >> .cshrc` should do it for tcsh.

I don't know about bash or zsh or ksh, sorry.


----------



## ccc (Dec 21, 2009)

THX, after:
	
	



```
# echo "set prompt = '%/ %# '" >> .cshrc
```
 works perfectly.


----------



## stevejones (Dec 21, 2009)

Install bash.

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


----------



## vivek (Dec 21, 2009)

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..


----------



## DutchDaemon (Dec 21, 2009)

The bash port does show 'user@host path' by default nowadays, no settings needed.


----------



## Deleted member 9563 (Dec 21, 2009)

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?


----------



## mickey (Dec 21, 2009)

Try something like this and fit to your liking:

```
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]


----------



## ccc (Aug 26, 2011)

Another solution from http://www.getsolved.com/desktop/un...ll-path-of-directory-in-command-line-freebsd/


```
# chsh -s /usr/local/bin/bash
```

You must have BASH in /usr/local/bin/ if not you can get it via ports:
	
	



```
# cd /usr/ports/shells/bash
# make install clean
```


----------



## graudeejs (Aug 26, 2011)

mickey said:
			
		

> Try something like this and fit to your liking:
> 
> ```
> set prompt = "%B%n@%m%b %{\033[35;1m%}%l%{\033[m%} [%{\033[36;1m%}%c04%{\033[m%}]: "
> ...



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


----------



## freethread (Aug 26, 2011)

or this one screen(4)()


----------

