Created
May 19, 2014 23:23
-
-
Save raamdev/8513448439b24264e9a2 to your computer and use it in GitHub Desktop.
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
| pushd() | |
| { | |
| if [ $# -eq 0 ]; then | |
| DIR="${HOME}" | |
| else | |
| DIR="$1" | |
| fi | |
| builtin pushd "${DIR}" > /dev/null | |
| ls -al | |
| echo "DIRSTACK: " | |
| dirs -v | |
| } | |
| pushd_builtin() | |
| { | |
| builtin pushd > /dev/null | |
| echo "DIRSTACK: " | |
| dirs -v | |
| } | |
| popd() | |
| { | |
| builtin popd > /dev/null | |
| echo "DIRSTACK: " | |
| dirs -v | |
| } | |
| go() | |
| { | |
| eval cd ~"${1}" | |
| } | |
| ls_enhanced() | |
| { | |
| if [ $# -eq 0 ]; then | |
| DIR="." | |
| fi | |
| if [ $# -eq 1 ]; then | |
| DIR="." | |
| fi | |
| if [ $# -gt 1 ]; then | |
| DIR="$2" | |
| fi | |
| ls -alG "${DIR}" | |
| echo "DIRSTACK: " | |
| dirs -v | |
| } | |
| alias cd='pushd' | |
| alias back='popd' | |
| alias flip='pushd_builtin' | |
| alias ls='ls_enhanced' | |
| alias go='go' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Awesome. Thank you! Love how these work together. The back/flip commands are nice and the DIRSTACK is great too. Also love the
goalias. However, I decided I prefer not to type the leading/when I use it; so I altered it just slightly.