Skip to content

Instantly share code, notes, and snippets.

@nopedev
Forked from KennethanCeyer/.bash_profile
Created April 4, 2018 02:06
Show Gist options
  • Select an option

  • Save nopedev/60e6aef08c03d2d112dbbac804613d9a to your computer and use it in GitHub Desktop.

Select an option

Save nopedev/60e6aef08c03d2d112dbbac804613d9a to your computer and use it in GitHub Desktop.

Revisions

  1. PIGNOSE revised this gist Oct 8, 2015. 1 changed file with 74 additions and 1 deletion.
    75 changes: 74 additions & 1 deletion .bash_profile
    Original file line number Diff line number Diff line change
    @@ -19,4 +19,77 @@ fi
    alias rm='rm -i'
    alias cp='cp -i'
    alias mv='mv -i'
    ".bash_profile" 97L, 2978C
    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'
  2. PIGNOSE created this gist Oct 8, 2015.
    22 changes: 22 additions & 0 deletions .bash_profile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    #.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'
    ".bash_profile" 97L, 2978C