Bashrc

From ArchWiki
Revision as of 23:53, 29 January 2008 by Alex anthony (talk | contribs) (Default command usage: spelling)
Jump to navigation Jump to search

A place for Arch users' .bashrc file tips and tricks

PS1

To colourise the bash prompt: Comment out the default PS1:

#PS1='[\u@\h \W]\$ '

The following PS1 is useful for a root bash prompt, with red designation and green console text:

PS1='\[\e[0;31m\]\u\[\e[m\] \[\e[1;34m\]\w\[\e[m\] \[\e[0;31m\]\$ \[\e[m\]\[\e[0;32m\] '

See also this wiki page

Aliases

Default command usage

To make bash prompt for removals

alias rm='rm -i'

To make spelling mistakes not matter

alias unmount='umount'
alias pakman='pacman'

Seen in forums to force someone to learn vim

alias nano='vi'

Shortcuts

Useful environment variables

Set a default text editor

EDITOR=nano
EDITOR=vi

Functions/Scripts

inputrc