Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Question 5 (0.5 points) On thor [YES, YOU MUST USE Thor and not some other syste

ID: 3701657 • Letter: Q

Question

Question 5 (0.5 points) On thor [YES, YOU MUST USE Thor and not some other system], what is the name of the fifth largest file within the /usr/include directory or any of its sub-directories? For your answer, just provide the file name- not the whole path to the file. Hint: pipe the output of your find command to sort -nr and redirect the output of sort to a file or to less. The sort command sorts its input. The-nr argument means "sort numerically and in reverse order" ab Save Question 6 (1 point) On thor [YES, YOU MUST USE Thor and not some other system], use the find command to determine cumulatively how many files with names ending in h within /usr/include and its sub-directories have been modified within the last 400 days. You may use we in your solution. To answer this question, copy and paste the exact command you used to find the answer Hint: Your answer should fit in the provided space for an answer Hint: Use man find to research find commands based on file modification times. Save

Explanation / Answer

Question: get the 5th largest file name in /usr/include directory

Answer: find /usr/include -name "*" | sort -nr | head -5 | sort -n | head -1

find /usr/include -name "*"  this will find the file in /usr/include directory and subdirectory.

sort -nr this will sort the output in numeric and reverse order

head -5 this will give first 5 element of output

sort -n this will sort the output in numeric order

head -1 this will give first line of output

-------------------------------------------------------------------------------------------------------

Question: No of File ending with .h and modified within last 400 days

Answer : find /usr/include -name "*.h" | find . -mtime -400 -exec ls -l {} ; | wc -l

here find /usr/include -name "*.h" will find the file in /usr/include directory and subdirectory which ending with .h

find . -mtime -400 -exec ls -l {} ; it will take the input of first and find the modified before 400 days and return the list of files.

wc -l  it will count the no in list and return the count

so finally we will get the no of file ending with .h and modified within 400 days .

Thank You

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote