Usage of ccze for tail, journalctl and cless
This commit is contained in:
parent
bcc80df707
commit
9a01507ab5
@ -1,16 +1,25 @@
|
||||
ccat(){
|
||||
cat $* | sed -u "s/ERROR/$(tput setaf 1)&$(tput sgr0)/gI"|sed -u "s/WARNING/$(tput setaf 3)&$(tput sgr0)/gI"|sed -u "s/INFO/$(tput setaf 2)&$(tput sgr0)/gI"|sed -u "s/DEBUG/$(tput setaf 6)&$(tput sgr0)/gI"
|
||||
TAIL_CMD=`which tail`
|
||||
JOURNALCTL_CMD=`which journalctl`
|
||||
|
||||
tail () {
|
||||
if grep -q -i "\-f" <<< "$*"
|
||||
then
|
||||
$TAIL_CMD $* | ccze -A
|
||||
else
|
||||
$TAIL_CMD $*
|
||||
fi
|
||||
}
|
||||
|
||||
cless(){
|
||||
ccat $* | less -r
|
||||
journalctl () {
|
||||
if grep -q "\-f" <<< "$*"
|
||||
then
|
||||
$JOURNALCTL_CMD $* | ccze -A
|
||||
else
|
||||
$JOURNALCTL_CMD $*
|
||||
fi
|
||||
}
|
||||
|
||||
ctail(){
|
||||
tail $* | ccat
|
||||
}
|
||||
|
||||
cgrep(){
|
||||
grep $* | ccat
|
||||
cless () {
|
||||
cat $1 | ccze -A | less -R
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user