Bash Attack

Bash is a great unix shell and one I work in everyday whether at the office or at home.

Everyone who uses this shell regularly will tweak it to match their own special quirks.

Here are some of mine.

Directory Aliases:

alias ls='ls --group-directories-first --time-style=+"%d.%m.%Y %H:%M" --color=auto'
alias ll='ls -l --group-directories-first --time-style=+"%d.%m.%Y %H:%M" --color=auto'
alias la='ls -la --group-directories-first --time-style=+"%d.%m.%Y %H:%M" --color=auto'

Up n directories, minimum one:

..() { if [ $1 -ge 0 2> /dev/null ]; then x=$1; else x=1; fi; for (( i = 0; i < $x; i++ )); do cd ..; done;

Current directory size listing:

alias dud='du --max-depth=1 -h'

Watch something:

function w() { watch -dn1 $*; }

Not much, but I hope someone finds them useful.

Like it? Tweet it!

Leave a Reply