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 2
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 1: 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 2: Create Files with Initial Data
Inside the data subdirectory, create two files: file1.txt and file2.txt Use the touch command.
Add the following text to each file:
o file1.txt: Hello, this is file1.
o file2.txt: This is file2.
Task 3: Display File Contents
Display the first two lines of file1.txt and the last line of file2.txt using the head and tail commands.
Hint: Redirect output to the terminal without modifying the files.
Task 4: Move Files
Move file1.txt and file2.txt to the logs directory using a relative path.
Task 5: Set Permissions
Change the permissions of file1.txt to allow only the file owner to read and write, but deny execution. Ensure no group or others have any permissions.
Set file2.txt so that anyone (owner, group, others) can read the file, but only the owner can write to it.
Task 6: Create a New User and Group
Create a new user called project_user and a group called project_group.
Add project_user to project_group and set their default shell to /bin/bash.
Task 7: Change File Ownership and Set Special Permissions
Change the ownership of logs and everything inside it to project_user and project_group.
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 8: 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 9: Default Permissions with umask
Check your current umask value and record it.
Change the umask value so that all new files created by project_user in logs have the default permission rw-r-----(640).
Task 10: Submit Project
Submit the project_backup directory by providing a screenshot showing the file structure and permissions inside project_backup.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!