readloggit - Reading loggit's Logfile
Reading the loggit Logfile
Of course you can simply type "cat /var/log/loggit.log | more" to view the logfile. But I have a hard and fast rule in Unix/Linux: if you have to do something more than once, make is easy to repeat.
In this case, I've put that command inside a shell script. Now all I have to do is type "readloggit" and a paginted display appears
Installing readloggit
- Copy the script below and paste it into a text file on your system.
- Save the textfile as "readloggit"
- Either use sudo or /bin/su - to the root account.
- Move the file to /usr/local/bin.
- Execute: chmow 755 /usr/local/bin/readloggit
- Execute chown root:root /usr/local/readloggit
The readloggit Script
#!/bin/sh
# $Id: $
#
#######################################################
#
# Filename: readloggit
# Author: Kay-Marie Slaughter
# Date: Saturday, July 16, 2016, 14:5:49 EDT
#
# Purpose: Cat /var/log/loggit.log through less to view log.
#
# Notes: Written for Red Hat Enterprise Linux 6,7.
# If you don't have less on your system distribution,
# use more.
#
#######################################################
#
LOG="/var/log/loggit.log"
# either of these lines will display the logfile
/bin/less ${LOG}
# /bin/cat ${LOG} | more
#
# *** END OF SCRIPT ***
#