ASSIGNMENT – 2nd
STUDENT ID – 11555225
STUDENT NAME – AJRA LOVEPREET SINGH
Task 1
Log file
A file which contains the records of all goes in and out things of a server is known as log file. For example it same as black box in airplane that records everything when a problem arises in the plane. All the time it records information in chorological order and it is stored in root directory or in a secondary directory, depending on how it is set on the server. The server administrator has access of log file because it is protected by password and server administrator has record of everyone.
Uses and methods of storing log files
1. For the purpose of troubleshooting, system administrator needs to look at log files. …show more content…
By using who command the content of this file can be seen.
Task 2
Top ten IP addresses in log file and the numbers how many times the IP address appeared.
Description of how this pipeline works
$ grep -Eo "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" x06|sort|uniq –c|sort -nrk1|head >ass2.txt
The following command generates a list of all IP addresses that have attempted to connect to your web server. grep -Eo "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" (Folson,2008). grep /* This command match the pattern given in command*/
X06 /*It is the name of log file*/
| /*this pipe sign is used for complex things and it is also used to pass the output of one command to another as input*/
Sort /*put the lines in sequence (alphabetical order)*/
Uniq –c /*it counts the number of an command*/
Sort –nrk1 /*it compares the string numeric value*/
Head /*it prints the first 10 lines of a file*/
>ass2.txt /*this command save the output in ass2.txt