Question

LINUX: Question 1) There has been suspicious activity on the system.  In order to preserve log information,...

LINUX:

Question 1)

There has been suspicious activity on the system.  In order to preserve log information, it will be necessary to archive the current files in /var/logending with the ".log" extension.  The files are to be saved to a file named log.tar, stored in the directory, ~/archive.  

It has also been requested that the files that were archived be saved to a directory, ~/backup.

Objectives

- Create an archive named log.tar that is stored in the archive directory located in the home directory.

- Remove path names from the files that are archived.

- Produce verbose output while archiving.

- List the contents of the archive without extracting.

- Extract the files to the directory, ~/backup.

*Provide the final commands for successful completion.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

The commands for given tasks are as follows:

Create archive directory at home location

mkdir ~/archive;

Create an archive named log.tar that is stored in the archive directory located in the home directory.

Remove path names from the files that are archived.

cd /var/log && tar -cvf ~/archive/log.tar *.log;cd;

Note : the above command archives tar file in given location and removed full path from filenames as well

List the contents of the archive without extracting.

tar -tf ~/archive/log.tar;

Extract the files to the directory, ~/backup.

mkdir ~/backup;

tar -xvf ~/archive/log.tar -C ~/backup;

The output screenshot:

Please provide thumbs up if you like the solution

Add a comment
Know the answer?
Add Answer to:
LINUX: Question 1) There has been suspicious activity on the system.  In order to preserve log information,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT