Tag Archives: bash

Prompt with 2 directories

bash To only show the last 2 directories in prompt, there are two scripts at the Muffin Research Labs.The best one would be this: Add this to .bash_profile and replace \w by $(PWD) (note the parents!) in your PS1 line in that file. A more comfort version which replaces the home directory by a tilde,… Read More »

bash Tips & Tricks

Bourne Again Shell. bash magic Some handy bash magic. sudo last command If you forgot sudo after executing your 3-lines-command, sudo bang! bang! will repeat the last entered command with sudo prefixed. More parameter magic bang Expands to !$ last argument of previous command !$:p just show last argument of previous command, don’t add to… Read More »