I added this to ~/.bashrc
to provide colorized tail:
tailc () {
tail $@ | ccze
}
And I can run it as so: tailc -f -n 10 foo/log.txt
But I can't use it on a privileged file:
sudo tailc -f -n 10 /var/log/syslog
Error:
bash: tailc: command not found
I know I can do it like this: sudo bash -i -c '...'
but I want to know if I can run it without that more complicated syntax. What can I do to be able to just type sudo tailc ...
?
BTW, I added that function to /root/.bashrc
as well, but that didn't help either.