Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please just provide me with the command I would use, thank you so much. You have a shell variable named LOGNAME that contains your login

image text in transcribed

image text in transcribed

Please just provide me with the command I would use, thank you so much.

You have a shell variable named LOGNAME that contains your login name. I want one command line that will set the shell variable GNUM to the group ID for you listed in the password file. Please do not directly use your login name in the command like "grep 'quizhao /etc passwd, please use the LOGNAME. Hint: What is the format of /etc/passwd file? How to use a variable's value in command? How to use regular expression to find your login name in such a file? Or you may have a smarter way. GNUM-S(cat /ets/passwd grep SLOGNAME cut-d:-f4) The next couple questions deal with the file lastlog". 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 10. The right-most information is how long the user was logged in for, the format is like "(daysthoursminutes)". The "days" part will be missing if the user was on for less than 24 hours How many times was the user "tfulkers" logged in for more than a day, according to this file, and what command did you come up with to figure this out? You have a shell variable named LOGNAME that contains your login name. I want one command line that will set the shell variable GNUM to the group ID for you listed in the password file. Please do not directly use your login name in the command like "grep 'quizhao /etc passwd, please use the LOGNAME. Hint: What is the format of /etc/passwd file? How to use a variable's value in command? How to use regular expression to find your login name in such a file? Or you may have a smarter way. GNUM-S(cat /ets/passwd grep SLOGNAME cut-d:-f4) The next couple questions deal with the file lastlog". 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 10. The right-most information is how long the user was logged in for, the format is like "(daysthoursminutes)". The "days" part will be missing if the user was on for less than 24 hours How many times was the user "tfulkers" logged in for more than a day, according to this file, and what command did you come up with to figure this out

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

Oracle Database 19c DBA By Examples Installation And Administration

Authors: Ravinder Gupta

1st Edition

B09FC7TQJ6, 979-8469226970

More Books

Students also viewed these Databases questions