Difference between revisions of "Bashrc"

From ArchWiki
Jump to navigation Jump to search
(Added Information)
Line 1: Line 1:
 
A place for Arch users' .bashrc file tips and tricks
 
A place for Arch users' .bashrc file tips and tricks
 
==PS1==
 
==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 [[Color Bash Prompt | this wiki page]]
 
==Aliases==
 
==Aliases==
  

Revision as of 23:53, 29 January 2008

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 orums 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