Tip Details Add a Related Tip

Rate as: Positive Negative

Update your shell prompt

If you use the shell in Linux, Unix, the Mac, or any other *nix system, you really owe it to yourself to update the command line prompt. The default prompt is nearly worthless, and there are a lot of options available for making it better.

This article (http://www.ibm.com/developerworks/linux/library/l-tip-prompt/) provides a good primer on how to get started.

For me, I like to see my path in the prompt. But when I am in my root directory, I don't care about the full path, I only care about the part of the path under my root directory. If you want to give this a try, here's how to set your PS1 parameter:

PS1='${PWD##*rootDirName/}: '

where your replace rootDirName with the name of your root directory. For example, if the path to your root directory is: /users/tomp, you would replace rootDirName with tomp. Give it a try, I bet you'll like it better than the default prompt.
Link: www.ibm.com...Search for more tips related to this link
Rating: no ratings, 0 total Votes
Categories: UNIX Mac linux shell
Added: on Jun 04, 2007 at 9:15 pm
Added By: an anonymous user

Comments on this Tip

Add a Comment
There are no comments for this tip
Your Comment:
(how to format)
Rate This Tip:

Verify Humanity:
Sorry, we know it's annoying, but please enter the characters shown in the image to the left so that we know you're an actual person and not an evil spammer. Thanks.
       

Related Tips

ssh and scp without passwords

Categories: shell Mac linux UNIX
100% positive, 1 comment - last added on Jun 20, 2008 at 9:19 am
– Tip added by an anonymous user on Dec 21, 2007 at 2:51 pm

Running X11 programs from the terminal

no ratings, 0 comments
– Tip added by an anonymous user on Jan 28, 2008 at 8:04 am

Changing an already running job to execute in the background

Categories: linux UNIX Mac
no ratings, 0 comments
– Tip added by an anonymous user on Aug 06, 2007 at 11:57 am

Color coding the ls command in Fedora

100% positive, 0 comments
– Tip added by an anonymous user on Apr 25, 2008 at 8:27 am

iTerm for the Mac

Categories: Computers Mac UNIX
66% positive, 1 comment - last added on Mar 06, 2007 at 4:29 pm
– Tip added by rlansky on Mar 03, 2007 at 7:02 am

Software Development Automation with Scripting Languages

Categories: linux unix scripting
no ratings, 0 comments
– Tip added by an anonymous user on Jun 05, 2008 at 2:40 pm

web clip widgets

100% positive, 0 comments
– Tip added by an anonymous user 2 days, 23 hours ago

Remove Spotlight icon from manu bar

100% positive, 0 comments
– Tip added by an anonymous user 4 days, 3 hours ago

Installing PHP GD on a Leopard Mac

100% positive, 0 comments
– Tip added by an anonymous user 6 days, 19 hours ago

Adding searches to the Finder sidebar

100% positive, 0 comments
– Tip added by an anonymous user on Jun 27, 2008 at 9:07 am

Speeding Office 2008 on a Mac

100% positive, 1 comment - last added on Jun 26, 2008 at 3:20 pm
– Tip added by an anonymous user on Jun 26, 2008 at 11:26 am

Quick searches in Safari

Categories: Mac safari search shortcut
100% positive, 0 comments
– Tip added by an anonymous user on Jun 25, 2008 at 9:26 am

Quickly emailing links on a Mac

Categories: Mac email shortcut
100% positive, 0 comments
– Tip added by an anonymous user on Jun 20, 2008 at 6:31 am

Printing Keynote handouts

100% positive, 0 comments
– Tip added by an anonymous user on Jun 19, 2008 at 5:48 pm

running multiple firefox versions on a Mac

Categories: browsers firefox Mac
100% positive, 1 comment - last added on Jun 18, 2008 at 7:58 am
– Tip added by an anonymous user on Jun 18, 2008 at 7:53 am

Aperture loupe style

no ratings, 0 comments
– Tip added by an anonymous user 3 days, 2 hours ago

Avoid messaging when apps hang on a Mac

Categories: Mac crash shortcut
no ratings, 0 comments
– Tip added by an anonymous user 3 days, 17 hours ago

Watch hi-def movie trailers in Front Row

Categories: Mac movies Front Row HDTV
no ratings, 0 comments
– Tip added by an anonymous user 4 days, 2 hours ago

keep track of the phase of the moon

Categories: Mac astronomy moon menu bar
no ratings, 0 comments
– Tip added by an anonymous user on Jun 23, 2008 at 4:53 pm

iPod Nano on desktop but not in iTunes

Categories: Mac iPod repair
no ratings, 0 comments
– Tip added by an anonymous user on Jun 19, 2008 at 8:47 am