Difference between revisions of "Bashrc"

From Mark Furneaux's Wiki
Jump to: navigation, search
 
Line 13: Line 13:
 
==History By Date==
 
==History By Date==
 
HISTFILE="${HOME}/.history/$(date -u +%Y/%m/%d.%H.%M.%S)_${HOSTNAME_SHORT}_$$"
 
HISTFILE="${HOME}/.history/$(date -u +%Y/%m/%d.%H.%M.%S)_${HOSTNAME_SHORT}_$$"
 +
 +
==Time in Prompt==
 +
<syntaxhighlight lang="bash">
 +
if [ "$color_prompt" = yes ]; then
 +
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h@$(date +%I:%M%P)\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
 +
else
 +
    PS1='${debian_chroot:+($debian_chroot)}\u@\h@$(date +%I:%M%P):\w\$ '
 +
fi
 +
</syntaxhighlight>

Latest revision as of 22:19, 25 June 2017

.bashrc is a configuration file used by bash to configure the user's shell.

Aliases

These are some of my favorite aliases:

  • alias fuck='sudo $(history -p \!\!)'
  • alias xx='exit'
  • alias szfs='sudo zpool status'
  • alias izfs='sudo zpool iostat -v'
  • alias sagud='sudo apt update && sudo apt full-upgrade'
  • alias gs='git status'

History By Date

HISTFILE="${HOME}/.history/$(date -u +%Y/%m/%d.%H.%M.%S)_${HOSTNAME_SHORT}_$$"

Time in Prompt

if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h@$(date +%I:%M%P)\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h@$(date +%I:%M%P):\w\$ '
fi