There are two short assignments on Linux files. Need a commands for each objective of the assignments. The instruction is uploaded in this message.
Assignment 1 Instructions
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.logextension. The files are to be saved to a file namedlog.tar, stored in the directory,~/archive.
It has also been requested that the files that were archived be saved to a directory,~/backup.
- Create an archive namedlog.tarthat 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.
- Provide screen captures of the commands required to complete the tasks.
- The final result of the archive listing should match the following:
- The final result of the listing of thebackupdirectory should match the following:
- sysadmin@localhost:~/backup$ ls
- alternatives.log bootstrap.log dpkg.log mail.log
- auth.log cron.log kern.log
Assignment 2 Instructions
A staff member has requested a list of the names of the services recognized by the current Linux image. A file named/etc/serviceshas been located that contains the pertinent information; however it is not organized to easily determine all of the services.
Using a combination of pipes, redirects and control statements, produce output that contains only the service names. The entire task must be accomplished without using any intermediary files. Each service should only be listed once and captured to a file nameduniqueservices.txt, located in the home directory. Remove any blank lines or lines that are deemed to be comments.
There could be more than one possible solution for obtaining the desired results.
Save your time - order a paper!
Get your paper written from scratch within the tight deadline. Our service is a reliable solution to all your troubles. Place an order on any task and we will take care of it. You won’t have to worry about the quality and deadlinesOrder Paper Now
- Extract all the service names from the file.
- Sort the names alphabetically removing any duplicates.
- Remove any blank lines or lines that do not begin with a letter of the alphabet.
- Capture the final output to a file nameduniqueservices.txt.
- Count the lines in the file using a conditional command that is only executed if the previous combined commands are successful.
- Provide the final command line for successful completion.
- The final result should match the following: