Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

need help figuring out how to run these command Thank you! This exercise requires you to modify webstats.sh to collect and print out the following

need help figuring out how to run these command
Thank you! image text in transcribed
This exercise requires you to modify webstats.sh to collect and print out the following information from webstats.log. 1. Date range of the log. This would be the first (oldest) and last (newest) date in the file. 2. Total number of visits during the date range. 1 visit = 1 line 3. Total number of unique visitors. A unique visitor = a unique IP address. 4. 10 most frequent users and the number of times they visited 5. 5 most frequently accessed resources by the HTTP GET and POST requests and the number of times accessed. 6. 10 most accessed URLs and the number of time accessed. 7. Number of visitors using Internet Explorer broken down by version. 8. Number of visitors using Firefox broken down by version. 9. Number of visitors using any other browser. Although it seems complicated, each piece of statistical data can be retrieved using a few commands. You may need to use a single command multiple times in one command chain The following commands are the only ones needed to complete this exercise. You may need to combine command options. head -- X // Show the first X lines of a text file. If -n not specified, default is 10 tail -n X // Show the last X lines of a text file If -n not specified, default is 10 cut -f X // Extract column X from a line of text cut -d 'X' // Extract a column where columns are separated by the character X tr''' // Translate a set of characters with another set in a text file tr-d'' // Delete a set of characters from a text file . sed 's/xx/yy/g' // Substitute characters xx with yy in a text file wc-1 // Show the number of lines in a text file sort // Sort a text file alphabetically sort -n // Sort a text file numerically sort-r // Sort a text file in reverse order sort -u // Sort a text file numerically but remove duplicate lines uniq-c Il Count the number of adjacent unique lines in a text file grep '' // Show all lines in a text file that matches the specified pattern grep -v // Exclude all lines in a text file that matches the specified pattern printf // Print a message

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Put Your Data To Work 52 Tips And Techniques For Effectively Managing Your Database

Authors: Wes Trochlil

1st Edition

0880343079, 978-0880343077

More Books

Students also viewed these Databases questions

Question

Differentiate between negative reinforcement and punishment.

Answered: 1 week ago