ubuntu terminal directory

Palit, Nilanjan nilanjan.palit-ral2JQCrhuEAvxtiuMwx3w at public.gmane.org
Thu Mar 25 13:01:27 EDT 2010


> From: Derek Martin
> Sent: Thursday, March 25, 2010 12:15 PM

> On Thu, Mar 25, 2010 at 09:12:39AM -0400, Dan Ritter wrote:
> > > > why take up 3/4 of the first line with my path.  i already know 
> > > > where i am...  
> 
> Because, sometimes you don't.  Like after being away from your
> terminal for a while.  :)

Yep!

I prefer the following for my csh: I have aliased the cd command as follows:

alias cd 'cd \!*; set a = `pwd`; set b = ${a:h}; set prompt = %U$HOSTN%u":%B"${b:t}"/"${a:t}"%b> "'

What does it do? My machine (host) name (the part before the colon) is underlined. And my current path is in bold. And my path is just the lowest two levels of the tree (not the whole path) since that's all I need to know to get my bearings 99% of the time. If I need more for a command, I can always do `pwd`/filename. My prompt looks as follows (the underline and bold text is not obviously visible below):

filc20190:npalit/.ssh2> 

So while scrolling, it is very easy to distinguish my prompt from the terminal I/O. And the abbreviated path does not take up the whole line. I personally do not like the full separate line for the path since it takes up too much screen real estate and I typically tend to look at my past history a lot. But that's what suits my style. Everyone's styles/requirements are different.

-Nilanjan






More information about the Discuss mailing list