Find all files (not directories) within the /etc directory that are larger than 50kB.
Among those files, identify only those that contain the string text root.
Copy all matching files to the directory /root/audit_files.
You must ensure the destination directory exists first. Redirect all "Permission Denied" errors to /dev/null.
Solution
Grant permission to access root directory
sudo -i
Direct to root directory
cd /
Create directory
mkdir /root/audit_files
Find files
find /etc -type f -size +50k -exec grep -l "root" {} \; -exec cp {} /root/audit_files \; 2> /dev/null
Locate all files in the /var/log directory that have been modified (you may use -name "*.log" for this scope) and have a size greater than 1MB.
Create a gzipped tar archive named /root/log_backup.tar.gz containing these files.
Without extracting the archive, list its contents to verify the files were added correctly.
Verify the archive size (human readable) is smaller than the uncompressed total.
Solution
Grant permission to access root directory
sudo -i
Direct to root directory
cd /root
Find files then archive
find /var/log -type f -size +1M -name "*.log" | xargs tar -cvf log_backup.tar
Find files then compressed
find /var/log -type f -size +1M -name "*.log" | xargs tar -cvzf log_backup.tar.gz
List contents without extract
tar -tvf log_backup.tar.gz
Verify file size
ls -lhsi
Create a mount point at /mnt/data_research.
Mount the identified device (e.g., /dev/sdb1 or a virtual equivalent) to this directory.
Verify the mount is active using a command that shows the mount hierarchy.
Unmount the device and remove the directory once the task is complete.
Solution
Follow instruction in Connect External Storage To RHEL
Direct to mnt directory
cd /mnt
Create directory
sudo mkdir /mnt/data_research
Identify unmount device
lsblk
Mount device
sudo mount /dev/sdb1 /mnt/data_research
Verify mount device
findmnt | grep /mnt/data_research
Unmount device
sudo umount /mnt/data_research
Delete the directory
sudo rmdir /mnt/data_research
Eject the external storage by click eject icon in Files in RHEL
Create a file named /root/primary_config.
Create a hard link named /root/config_hard and a symbolic link named /root/config_soft pointing to the primary file.
Provide the command to prove that primary_config and config_hard share the same data on the disk (inode).
Delete the primary_config file.
Describe what happens to config_soft and why config_hard still functions.
Solution
Grant permission to access root directory
sudo -i
Direct to root directory
cd /root
Create file
touch primary_config
Create hard link
ln primary_config config_hard
Create symbolic link
ln -s primary_config config_soft
Verify inode
ls -li primary_config config_hard
Delete file
rm -rf primary_config
Verify status
ls -li config_soft config_hard
config_soft text become red