Skip to content

Instantly share code, notes, and snippets.

@oddlyzen
Last active July 6, 2025 21:41
Show Gist options
  • Save oddlyzen/c39d52fe4971e6e876f1b615e65d19d5 to your computer and use it in GitHub Desktop.
Save oddlyzen/c39d52fe4971e6e876f1b615e65d19d5 to your computer and use it in GitHub Desktop.

Revisions

  1. oddlyzen revised this gist Mar 20, 2017. 1 changed file with 13 additions and 20 deletions.
    33 changes: 13 additions & 20 deletions .bash_aliases
    Original file line number Diff line number Diff line change
    @@ -1,31 +1,14 @@
    # some more ls aliases
    # ls aliases
    alias ll='ls -alF'
    alias la='ls -A'
    alias l='ls -CF'
    alias d="ls -G"
    alias lsd="ls -lahG"

    # Add an "alert" alias for long running commands. Use like so:
    # sleep 10; alert
    alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'

    # alias ss="script/server"
    # alias sc="script/console"
    alias d="ls -G"
    alias ll="d"
    alias lsd="ls -lahG"
    alias lsa="ls -a"
    # alias cdt="cd ~/code/dtime_web"
    alias cdp="cd ~/Desktop/Projects"
    alias gs="git status"
    alias gca="git commit -am"
    # alias pgstart="pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start"
    # alias mmongo="mongod run --config /usr/local/Cellar/mongodb/1.8.2-x86_64/mongod.conf"
    alias mysqlstart="mysql.server start"
    alias my-sql="mysql -u root -p"
    # alias reloadtm="osascript -e 'tell app \"TextMate\" to reload bundles'"

    # ------
    # From others' .bash_aliases

    # Become system administrator
    alias god='sudo -i'
    alias root='sudo -i'
    @@ -100,4 +83,14 @@ cdls() {
    fi
    }

    # alias the function just defined
    alias cd='cdls'

    ###############################################
    # common on my system, your mileage may vary...
    alias cdp="cd ~/Desktop/Projects"
    alias gs="git status"
    alias gca="git commit -am"
    alias mysqlstart="mysql.server start"
    alias my-sql="mysql -u root -p"
    ###############################################
  2. oddlyzen revised this gist Mar 20, 2017. No changes.
  3. oddlyzen revised this gist Mar 5, 2017. 1 changed file with 0 additions and 18 deletions.
    18 changes: 0 additions & 18 deletions .bash_aliases
    Original file line number Diff line number Diff line change
    @@ -91,24 +91,6 @@ man2pdf() {
    fi
    }

    # man2html() {
    # if [[ -z $1 ]]; then
    # echo "USAGE: man2html [manpage]"
    # else
    # if [[ `find /usr/share/man -name $1\* | wc -l` -gt 0 ]]; then
    # out=/tmp/$1.html
    # if [[ ! -e $out ]]; then
    # man -H=google-chrome $1
    # fi
    # if [[ -e $out ]]; then
    # google-chrome $out
    # fi
    # else
    # echo "ERROR: manpage \"$1\" not found."
    # fi
    # fi
    # }

    # perform 'ls' after 'cd' if successful.
    cdls() {
    builtin cd "$*"
  4. oddlyzen created this gist Mar 5, 2017.
    121 changes: 121 additions & 0 deletions .bash_aliases
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,121 @@
    # some more ls aliases
    alias ll='ls -alF'
    alias la='ls -A'
    alias l='ls -CF'

    # Add an "alert" alias for long running commands. Use like so:
    # sleep 10; alert
    alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'

    # alias ss="script/server"
    # alias sc="script/console"
    alias d="ls -G"
    alias ll="d"
    alias lsd="ls -lahG"
    alias lsa="ls -a"
    # alias cdt="cd ~/code/dtime_web"
    alias cdp="cd ~/Desktop/Projects"
    alias gs="git status"
    alias gca="git commit -am"
    # alias pgstart="pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start"
    # alias mmongo="mongod run --config /usr/local/Cellar/mongodb/1.8.2-x86_64/mongod.conf"
    alias mysqlstart="mysql.server start"
    alias my-sql="mysql -u root -p"
    # alias reloadtm="osascript -e 'tell app \"TextMate\" to reload bundles'"

    # ------
    # From others' .bash_aliases

    # Become system administrator
    alias god='sudo -i'
    alias root='sudo -i'

    # For nano editor
    alias nano='nano -w'

    # apt-get aliases
    alias apt-install='sudo apt-get install'
    alias apt-search='apt-cache search'
    alias apt-show='apt-cache show'
    alias apt-purge='sudo apt-get --purge remove'
    alias apt-remove='sudo apt-get remove'
    alias apt-up="sudo apt-get update && sudo apt-get upgrade"
    alias apt-policy="LANG=C apt-cache policy"

    # Other
    alias emacs='emacs22-gtk'
    alias emacsfs='emacs22-gtk -fs'
    alias gohome='cd ~; clear'
    alias h='head'
    alias ls='ls --color=auto'
    alias reload='source $HOME/.bashrc'
    alias showalias='cat $HOME/.bash_alias'
    alias shr='shred -u '
    alias t='tail'
    alias temps='acpi -t'
    alias 'make_me_a_sandwich'='echo "What? Make it yourself"'
    alias 'sudo_make_me_a_sandwich'='echo "ok"'
    #find file
    alias f='find . |grep '
    #search history
    alias h='history|grep '
    #search processes
    alias p='ps aux |grep '
    #open any file or folder with default app
    alias o='xdg-open '
    #python calculator
    alias pc='python -i -Qnew -c "from math import *"'
    #python calculator (plus numpy and matplotlib)
    alias pcn='python -i -Qnew -c "from math import *;from pylab import *"'
    # Cool!
    alias !='sudo'
    alias ..='cd ..'
    alias ...='cd ../..'
    alias ....='cd ../../..'

    man2pdf() {
    if [[ -z $1 ]]; then
    echo "USAGE: man2pdf [manpage]"
    else
    if [[ `find /usr/share/man -name $1\* | wc -l` -gt 0 ]]; then
    out=/tmp/$1.pdf
    if [[ ! -e $out ]]; then
    man -t $1 | ps2pdf - > $out
    fi
    if [[ -e $out ]]; then
    /usr/bin/evince $out
    fi
    else
    echo "ERROR: manpage \"$1\" not found."
    fi
    fi
    }

    # man2html() {
    # if [[ -z $1 ]]; then
    # echo "USAGE: man2html [manpage]"
    # else
    # if [[ `find /usr/share/man -name $1\* | wc -l` -gt 0 ]]; then
    # out=/tmp/$1.html
    # if [[ ! -e $out ]]; then
    # man -H=google-chrome $1
    # fi
    # if [[ -e $out ]]; then
    # google-chrome $out
    # fi
    # else
    # echo "ERROR: manpage \"$1\" not found."
    # fi
    # fi
    # }

    # perform 'ls' after 'cd' if successful.
    cdls() {
    builtin cd "$*"
    RESULT=$?
    if [ "$RESULT" -eq 0 ]; then
    lsa
    fi
    }

    alias cd='cdls'