Cut the Bash Prompt Down to Size

The LinDesk weblog runs down the process of customizing the shell prompt to trim the current path down to a reasonable character limit—making typing long commands much simpler while under deeply nested folders.


The guide includes a number of options for customizing your prompt to include more information about the current path without overloading your screen with characters—one of the more interesting tweaks is this script that removes characters from the middle of the path, which will cut down the size while clearly identifying the current folder. To test it out, you can simply paste the following text into the terminal prompt:

PS1="[\$CurDir] \$ "

Hit the link for the walk-through and alternate prompt options, or you can customize your terminal greeting and reduce your terminal clutter with screen.


Customizing the Terminal: The Prompt [LinDesk]

Share This Story

Get our newsletter