Question
UNIX File Processing create a sesion log script -a homework1 For this project, download the text file weblog.txt (Links to an external site.) (see bottom
UNIX File Processing
create a sesion log script -a homework1
For this project, download the text file weblog.txt (Links to an external site.) (see bottom of question to copy text into txt file)
This file is an Apache web log taken from the web server for St. Mary's University. When a visitor goes to their web site, the visitor's browser makes a request to the web server to view a web page, which is a file residing on the server. Each time a page is requested by a browser, the web server records information about that request. This weblog.txt holds the details of some of those requests. See below for a list of fields with an example:
WEB LOG EXAMPLE:
Web Log Example
Example entry from weblog.txt (this is a single line that wraps):
140.184.37.105 - - [08/Aug/2001:21:06:36 -0300] "GET /~csc226/outline.htm HTTP/1.0" 200 9748 "http://cs.stmarys.ca/~csc226/" "Mozilla/4.73 [en] (WinNT; U)"
Description of the fields from left to right with excerpts from the example:
ip Address: 140.184.37.105
field not included: -
field not included: -
Date and Time enclosed in brackets: [08/Aug/2001:21:06:36 -0300]
Page Requested in quotes: "GET /~csc226/outline.htm HTTP/1.0"
HTTP Status Code returned to the client (200= successful): 200
Length in Bytes of the page transferred: 9748
Referring Site (site that the client was referred from) in quotes: "http://cs.stmarys.ca/~csc226/"
Requesting Software (software that made the request) in quotes: "Mozilla/4.73 [en] (WinNT; U)"
This file does not include all possible information that could be collected by a web server. The full description of the apache log file format can be found here: http://httpd.apache.org/docs/2.2/logs.html (Links to an external site.)Links to an external site.
REQUIREMENTS
Note: You will need to capture your work with the script command, just as you have been doing for the labs. Remember to begin logging before you begin work and use the exit command when you are finished to save your work to the session log file.
Part 1
Create a file called weblog.mod that contains the contents of the weblog.txt file that has been modified using each of the modification commands below. You can choose which ways you would like to modify the file, but you must use each following commands to do the modifications. Use output redirection to save the modifications to a file.
Modification commands (Module 5 & Lab 5)
awk cut paste sed sort tr
Part 2
Note: You are not required to accomplish more than one task with a single command. You can use as many commands as needed to accomplish the tasks below. Make sure you have started your session log before you begin.
Create a folder called project2 in your home directory and save or move the weblog.txt and weblog.mod files in that project2 directory.
Create a folder called public_html in your home directory and a subdirectory called bin.
Create a link to the weblog.txt and weblog.mod files in your ~/public_html/bin directory.
Use the ls command to demonstrate that the files are located in the correct directory.
Use the ls command to demonstrate that the links were created correctly.
Display the inodes for the contents of your home directory.
Display the inodes for all subdirectories of your home directory.
DELIVERABLES
For part 1: In the submission window, explain which modifications you made when creating the weblog.mod file and which command(s) you used to make each modification. Upload your weblog.mod file. Do not upload the weblog.txt file.
For part 2: Upload your session log.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started