“alias” use it for a good reason

In Linux we all work with lots of log files, like mail, squid, application etc…., all these files located in its own folder, for example, if we want to look for squid access log to monitor the site access, generally we do tail -f /var/log/squid/access.log, this involves lots of typing, we can make this simple with alias command in linux

#alias squidaccess=”tail -f /var/log/squid/access.log”

now you can simply type squidaccess in the terminal, and you can see the tailing output of access.log !!!!!!!!!!!

Description

alias – Command to create alias

squidaccess – name of the alias (it could be anything)

tail -f “filename” –  file name for continuously monitoring the file (this could be anything, we can use even use cd  command, to get in to that directory by typing the alias)

To make this permanent put in .bashrc file in your home directory vi ~/.bashrc  and add this at the end of the line

alias squidaccess=”tail -f /var/log/squid/access.log”

now quite the file and re login you shell to take effect.

About Anoop Nair

I am a Linux and Networking geek, Interest to learn more and fun to do new experiments, happy to share knowledge that I have learned and experienced in my life and carrier, also trying to learn more on Firewalls, Linux, Switching, Routing etc..............

Check Also

MySql replication

Disaster recovery of Mysql using DRBD and Heartbeat

Disaster recovery (DR) is the process, policies and procedures that are related to preparing for …