Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help me. I have attempted this but I don't think I am getting the result that I am supposed to. Please show the commands

Please help me. I have attempted this but I don't think I am getting the result that I am supposed to. Please show the commands you used and explain why used them. Thank you!

image text in transcribed

Exercise #3: Spying on the locate program [15pts] The locate command is really useful. It takes as argument a string and consults a database of all files in the file system, printing all matching files. You can try it right now on your system, for instance to search for all files with string "what" (yes, there should be a few). There is a database, somewhere on your file system, which locate consults. This database is typically regularly updated via the updatedb command. Just to make sure, before proceeding, update your system's local database by doing: sudo updatedb This could take a while, but most likely not. The objective if this exercise is to determine how "smart" locate is. That is: Does it read the whole database each time it executes? Or is the database structured (with hashes, and index,..) so that locate only reads a part of the database? Use strace to spy on a call to locate searching for the string "hello": sudo strace -olocate output locate hello Important: Don't forget to include the file locate output in the archive you turn in. Answer the following questions: [q1] Based on the strace output, what is the path to the database file on your system? (this is a file that's opened by locate and that should have some database-ish name). Cut-and-paste into your report the line of strace's output that made it possible to find this out [q2] How many bytes of content are read from the database file? Explain how you made this determination. [q3] Is the whole content of the database file read? Explain how you made this determination. [q4] Do you conclude that locate is smart or not smart? If not smart, what could be a conceivable

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

Upgrading Oracle Databases Oracle Database New Features

Authors: Charles Kim, Gary Gordhamer, Sean Scott

1st Edition

B0BL12WFP6, 979-8359657501

More Books

Students also viewed these Databases questions

Question

Define Administration and Management

Answered: 1 week ago

Question

Define organisational structure

Answered: 1 week ago

Question

Define line and staff authority

Answered: 1 week ago

Question

Define the process of communication

Answered: 1 week ago

Question

Explain the importance of effective communication

Answered: 1 week ago