-
-
Save nopedev/60e6aef08c03d2d112dbbac804613d9a to your computer and use it in GitHub Desktop.
bash_profile for MAC users
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#.bash_profile | |
if [ -f ~/.bashrc ]; then | |
. ~/.bashrc | |
fi | |
#============================================================ | |
# | |
# ALIASES AND FUNCTIONS | |
# Arguably, some functions defined here are quite big. | |
# If you want to make this file smaller, these functions can | |
#+ be converted into scripts and removed from here. | |
# | |
#============================================================ | |
#------------------- | |
# Personnal Aliases | |
#------------------- | |
alias rm='rm -i' | |
alias cp='cp -i' | |
alias mv='mv -i' | |
alias cl='clear' | |
# -> Prevents accidentally clobbering files. | |
alias mkdir='mkdir -p' | |
alias h='history' | |
alias j='jobs -l' | |
alias which='type -a' | |
alias ..='cd ..' | |
# Pretty-print of some PATH variables: | |
alias path='echo -e ${PATH//:/\\n}' | |
alias libpath='echo -e ${LD_LIBRARY_PATH//:/\\n}' | |
alias du='du -kh' # Makes a more readable output. | |
alias df='df -kTh' | |
#------------------------------------------------------------- | |
# The 'ls' family (this assumes you use a recent GNU ls). | |
#------------------------------------------------------------- | |
# Add colors for filetype and human-readable sizes by default on 'ls': | |
alias ls='ls -h' | |
alias lx='ls -lXB' # Sort by extension. | |
alias lk='ls -lSr' # Sort by size, biggest last. | |
alias lt='ls -ltr' # Sort by date, most recent last. | |
alias lc='ls -ltcr' # Sort by/show change time,most recent last. | |
alias lu='ls -ltur' # Sort by/show access time,most recent last. | |
# The ubiquitous 'll': directories first, with alphanumeric sorting: | |
alias ll="ls -alv" | |
alias lm='ll |more' # Pipe through 'more' | |
alias lr='ll -R' # Recursive ls. | |
alias la='ll -A' # Show hidden files. | |
alias tree='tree -Csuh' # Nice alternative to 'recursive ls' ... | |
#------------------------------------------------------------- | |
# Tailoring 'less' | |
#------------------------------------------------------------- | |
alias more='less' | |
export PAGER=less | |
export LESSCHARSET='latin1' | |
export LESSOPEN='|/usr/bin/lesspipe.sh %s 2>&-' | |
# Use this if lesspipe.sh exists. | |
export LESS='-i -N -w -z-4 -g -e -M -X -F -R -P%t?f%f \ | |
:stdin .?pb%pb\%:?lbLine %lb:?bbByte %bb:-...' | |
# LESS man page colors (makes Man pages more readable). | |
export LESS_TERMCAP_mb=$'\E[01;31m' | |
export LESS_TERMCAP_md=$'\E[01;31m' | |
export LESS_TERMCAP_me=$'\E[0m' | |
export LESS_TERMCAP_se=$'\E[0m' | |
export LESS_TERMCAP_so=$'\E[01;44;33m' | |
export LESS_TERMCAP_ue=$'\E[0m' | |
export LESS_TERMCAP_us=$'\E[01;32m' | |
#------------------------------------------------------------- | |
# Spelling typos - highly personnal and keyboard-dependent :-) | |
#------------------------------------------------------------- | |
alias xs='cd' | |
alias vf='cd' | |
alias moer='more' | |
alias moew='more' | |
alias kk='ll' | |
#------------------------------------------------------------- | |
# Using in MAC | |
#------------------------------------------------------------- | |
alias desk='cd ~/Desktop' | |
alias cl='clear' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment