Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Linux command ligne assigment 5-Execute the tar command to create an archive starting from ./rcd. Do not use compression. Put the archive in /tmp. What

Linux command ligne assigment

5-Execute the tar command to create an archive starting from ./rcd. Do not use compression. Put the archive in /tmp. What command did you use?

If you have done this correctly, how large is the resulting tar file?

6. Execute the tar command to create an archive starting from ./rcd. This time use the z option to compress the archive. Put the archive in /tmp. What command did you use?

7. How large is this file?

These questions deals with the file access_log in this directory. This file is a capture of the HTTP accesses for this machine for a period of a year or so.

8. How many accesses were made in January 2016?

9. What command did you use to determine this?

10. How many times did the IP address 66.249.66.123 request files from this server?

11. Part of each log entry includes the files that were accessed on the web server. For example, favicon.ico is one. Write a command that will tell me the unique files that have been accessed. All of GET, HEAD, and POST count.

12. How many unique files did you see from the previous question?

13. Show me a command that would change all of the dates 2016 to 2017 in the access_log file and create a new file called updated_log.

14. Copy the file access_log to your home directory, or somewhere where you can modify it. Go back to your home directory, or wherever, and use gzip to compress the file. What is the resulting filename and how large is the file?

15. OK, done with my files. Show me a command to convert all occurrences of the word OLD in some file with the word NEW, even if there are several of them on a line, and writing the output to stdout.

16. Show me a command that will look for any digit 0-9 and replace it with the corresponding letter A-J. For example, one is 1 two is 2 would come out one is B two is C.

17. Show me a command that will print the lines of a file which do not contain the word Linux, in either upper or lower case or a mixture. (Since we are matching words, a string like Linuxes is not considered to be the word Linux).

18. You have a shell variable named LOGNAME that contains your login name. I want one commandlinethat will set the shell variable GNUM to the group ID for you listed in the password file.

19. Show me one command line that will use ps ef and others to produce a list of your current processes but sorted by PPID.

20. Using the previous GNUM variable, I want one command line that will print a vertical bar |, your user ID in 20 columns and right justified, followed by is in group and then the group number, printed in five columns, followed by another vertical bar |. For example (for me):

| username is in group 0 |

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.

21. 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?

22. I have seen some suspicious activity from IP addresses that start with 68.99. In the file they will be listed as 68-99- or as ip68-99- and they may have .om on the end. (These are Cox users in Omaha. For the correct answer you will need to figure out how to eliminate the extra junk and just use the IP address.) I want you to create one command that will give me a sorted list of these suspicious users in the following format:

adammuno 68-99-4-45

ajgehrin 68-99-5-15

(snip many are cut out)

wmahoney 68-99-3-88

zfaulkne 68-99-28-102

Cool, eh? You may need to use I know because I had to figure it out the combination of grep, sed (with multiple e options), awk, sort, and uniq. The correct output should have 32 people that match. What did you come up with?

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

Students also viewed these Databases questions

Question

2. Why?

Answered: 1 week ago

Question

1. Where do these biases come from?

Answered: 1 week ago