diff options
Diffstat (limited to 'bash/bashrc')
-rw-r--r-- | bash/bashrc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/bash/bashrc b/bash/bashrc index 2947bf0..09d6a95 100644 --- a/bash/bashrc +++ b/bash/bashrc @@ -55,6 +55,23 @@ cu() cd "${dir}" } +# head/tail shortcut +# e.g. "lt|h" or "h lt" +__ht() +{ + local cmd=$1 + shift + + if [ $# -ne 0 ]; then + $@ | $cmd + else + $cmd + fi +} + +h() { __ht "head -32" $@; } +t() { __ht "tail -32" $@; } + # define the prompt . ~/.config/bash/prompt PS1=$(__prompt_func) |