« Testing the Nikon 80-400mm f/4.5-5.6 AF VR lens - not for sports (read on) | Main | Keyboards, lifeline to liking a computer; Apple's new (2007) wireless keyboard and my little review »

ksh Prompt Customization

I continually forget how to do this (because I usually set it up once and never again), so I'm making a quick note of how to show the shortened hostname, username and current directory at the prompt under ksh (the default shell for OpenBSD). In the standard .profile file, enter:

HOST=`hostname`
export PS1='${USER}@${HOST%%.*} ${PWD##*/} $ '

There are ways to add color, etc. to this, but I like the plain, vanilla look it produces. Finally, I won't be likely to run commands on a machine where I shouldn't be.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About

This page contains a single entry from the blog posted on November 16, 2007 9:12 AM.

The previous post in this blog was Testing the Nikon 80-400mm f/4.5-5.6 AF VR lens - not for sports (read on).

The next post in this blog is Keyboards, lifeline to liking a computer; Apple's new (2007) wireless keyboard and my little review.

Many more can be found on the main index page or by looking through the archives.

Creative Commons License
This weblog is licensed under a Creative Commons License.