From 435de69a4abe801989f273c91bc62bc10018542b Mon Sep 17 00:00:00 2001 From: nojhan Date: Sun, 29 Jul 2012 22:43:57 +0200 Subject: [PATCH] changes the default head/tail behaviour to output x lines, where x is the number of lines currently displayed on your terminal --- .bashrc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.bashrc b/.bashrc index 9e719f7..c713d4e 100644 --- a/.bashrc +++ b/.bashrc @@ -77,6 +77,11 @@ alias lm='ls -al --color=none|less' # pipe through 'less' alias ll='ls -l' alias tree='tree -Csu' # nice alternative to 'ls' +# changes the default head/tail behaviour to output x lines, +# where x is the number of lines currently displayed on your terminal +alias head='head -n $((${LINES:-`tput lines 2>/dev/null||echo -n 12`} - 2))' +alias tail='tail -n $((${LINES:-`tput lines 2>/dev/null||echo -n 12`} - 2))' + # nautilus file manager in browser mode without destkop management alias nautile='nautilus --no-desktop --browser'