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.
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
LINUX: Question 1) There has been suspicious activity on the system. In order to preserve log information,...