Question: Assignment 2 Red Hat Linux Practical Assignment Instructions: Complete the following tasks in sequence. Each task builds on the previous one, so be sure to
Assignment
Red Hat Linux Practical Assignment
Instructions: Complete the following tasks in sequence. Each task builds on the previous one, so be sure to save your work as needed. Use the appropriate commands and tools.
Task : Create a Directory Structure
Create a directory structure inside your home directory called project. Inside project, create two subdirectories: logs and data. Use absolute paths.
Task : Create Files with Initial Data
Inside the data subdirectory, create two files: filetxt and filetxt Use the touch command.
Add the following text to each file:
o filetxt: Hello this is file
o filetxt: This is file
Task : Display File Contents
Display the first two lines of filetxt and the last line of filetxt using the head and tail commands.
Hint: Redirect output to the terminal without modifying the files.
Task : Move Files
Move filetxt and filetxt to the logs directory using a relative path.
Task : Set Permissions
Change the permissions of filetxt to allow only the file owner to read and write, but deny execution. Ensure no group or others have any permissions.
Set filetxt so that anyone owner group, others can read the file, but only the owner can write to it
Task : Create a New User and Group
Create a new user called projectuser and a group called projectgroup.
Add projectuser to projectgroup and set their default shell to binbash
Task : Change File Ownership and Set Special Permissions
Change the ownership of logs and everything inside it to projectuser and projectgroup.
Set the logs directory so that new files created inside it inherit the group ownership setgid
Hint: Use chown and chmod with special permissions.
Task : Use File Globbing to Search Files
Use file globbing to list all txt files in the logs directory.
Then, use grep to search for the word file in all txt files in logs
Hint: Use wildcards and relative paths.
Task : Default Permissions with umask
Check your current umask value and record it
Change the umask value so that all new files created by projectuser in logs have the default permission rwr
Task : Submit Project
Submit the projectbackup directory by providing a screenshot showing the file structure and permissions inside projectbackup.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
