prwd 1.8

Reduced working directory
prwd is a command-line tool that prints a reduced working directory for your prompt shell (PS1). The path can be shortened using any of the following:

 * aliases
 * max length and filler characters
 * newsgroup style

All of this is driven by your ~/.prwdrc file.

The reason for prwd is that most shells read $PS1 differently and have a very rigid way to display the current working directory. prwd allows you to have one way to handle the display of your working directory and use it across multiple shells.

The syntax of the configuration files is described below, lines starting with '#' are ignored.


sudo make install


This will depend on your shell, but in general the following will do:

export PS1='h:`prwd`p '

Note that the single quote matters since you want to keep the command within the variable as-is (unresolved).

last updated on:
August 27th, 2013, 13:45 GMT
developed by:
Bertrand Janin
license type:
ISC License (ISCL) 
ROOT \ Utilities


In a hurry? Add it to your Download Basket!

user rating



1 Screenshot
What's New in This Release:
  • This version adds "hostname" and "uid_indicator" configuration flags, allowing prwd to completely replace the default PS1 behavior of most shells, uses the environment PWD as a reference if possible to display symlinked directories properly, checks the validity of the directories when dumping environment variables (when using -a), and allows one level of nested aliases.
read full changelog

Add your review!