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

I need help with this Linux question. We need to know how many times a user was

ID: 3804268 • Letter: I

Question

I need help with this Linux question. We need to know how many times a user was logged in more than a day So I need help coming up with a command that will give me the answer. The next couple questions deal with the file "last log". Take a look at it if you like, it is just the output of a command called "last'. It is in that same directory as before, and you can use it there or copy it if you like. The right-most information is how long the user was logged in for the format is like days hours minutes) The "days" part will be missing if the user was on for less than 24 hours. How many times was the user "rfulkers" logged in for more than a day, according to this file, and what command did you come up with to figure this out?

Explanation / Answer

Try this script.

$(last | grep $* | wc -|)

As we know $ is used for linux script

Last command is used to read the log files

Grep is used to search for the named files

Wc is used for the count, so overall this script should count for the log files with named files and no of times logged in