Skip to content

Instantly share code, notes, and snippets.

@SethMMorton
Created June 9, 2012 16:45
Show Gist options
  • Save SethMMorton/2901718 to your computer and use it in GitHub Desktop.
Save SethMMorton/2901718 to your computer and use it in GitHub Desktop.
General Linux .bashrc
#! /bin/bash
############################################################################
# DON'T PUT ANY CUSTOMIZATIONS HERE (THEY MAY GET OVERWRITTEN BY THE SYSTEM)
############################################################################
# Source global definitions
if [ -f /etc/bashrc ]; then # Fedora
. /etc/bashrc
elif [ -f /etc/bash.bashrc ]; then # Debian
. /etc/bash.bashrc
fi
#########################################
# PUT YOUR CUSTOMIZATIONS AFTER THIS LINE
#########################################
#------------------------------------
# Some useful variables and pathnames
#------------------------------------
export SVN_EDITOR=vim # Tell svn to use vim
export MANPATH=$MANPATH:$HOME/man # If you have a ~/man
export PATH=$PATH:$HOME/bin # If you have a ~/bin
export PYTHONPATH=$HOME/programming # Or wherever your python code is
#------------------------------------
# User specific aliases and functions
#------------------------------------
# Useful shortcut to quickly open .bashrc and source it
alias bashrc="vi ~/.bashrc; source ~/.bashrc"
# Make a patch file between two source trees
alias make_patch="diff -uNr"
# Clear the screen of your clutter
alias c="clear"
alias cl="clear;ls;pwd"
# Make grep use color by default, and make a shortcut to using perl regex
alias grep="grep --color"
alias grepp="grep -P --color"
# Shortcuts for various ls options. All of these add colors, ignore files
# ending with '~', and add '/' to the end of folders. Shortcuts ending
# with 'a' show hidden files as well, except the redundant '.' and '..'.
alias ls="ls -pB --color"
alias la="ls -pA --color"
alias ll="ls -phl --color" # long-form list
alias lla="ls -phlA --color"
alias lz="ls -pshS --color" # sort by file size
alias lza="ls -pshSA --color"
alias lt="ls -pghotr --color" # long-form, sort by modification date
alias lta="ls -pghotrA --color"
alias lx="ls -pghoX --color" # sort by file extention
alias lxa="ls -pghoXA --color"
alias lr="ls -ARpsh --color" # recursive list (watch out! It will fill your screen!)
# Make some of the file manipulation programs verbose
alias mv="mv -v"
alias rm="rm -v"
alias cp="cp -v"
# Prints disk usage in human readable form
alias d="du -sh"
# Removes transparency when displaying an image
alias show="display -flatten"
@benyanke
Copy link

benyanke commented Jul 26, 2016

Thanks for sharing! I'll be putting many of these useful things into my own bashrc. I'm glad I'm not the only one who made myself a "bashrc" alias!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment