Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In linux I would like this completed in:::: Task 3 Create two text files name file1 and file2. file1 file 001 056 127 258 file2
In linux I would like this completed in::::
Task 3 Create two text files name file1 and file2. file1 file 001 056 127 258 file2 file INFO 1111: Linux INFO-1111: LINUX 002 056 167 369 Provide a screenshot demonstrating you completed this task successfully. Your screenshot below: Task 6 Use the comm command to compare file1 and file2 and suppress the first column of the output. Provide a screenshot demonstrating you completed this task successfully. Your screenshot below: Task 9 Use the comm command to compare the avengers.txt and avenger2.txt file. The comm command requires files to be sorted. Since the avengers text files are not sorted you will receive an error. What error do you receive. Your answer below: Task 10 To override the error received by unsorted files, use the --nocheck-order option with comm. comm --nocheck-order avengers.txt avengers2.txt Provide a screenshot showing successful completion of this task. Your screenshot below: INFO-1111: LINUX Task 12 Compare the 2 avengers files separating each column with commas (,). Provide a screenshot showing successful completion of this task. Your screenshot below: Sort the supplies.txt file created in a previous lab and redirect the sort to a new file called sorted_supplies.txt sort -n supplies.txt > sorted_supplies.txt Provide a screenshot showing successful completion of this task. Your screenshot below: Task 18 The paste command pastes 2 or more files side by side. Use the following command to paste the office.txt file (created in a previous lab) on the left and the sorted_supplies.txt file to the left. paste office.txt sorted_supplies.txt Provide a screenshot showing successful completion of this task. Your screenshot below: Sort the supplies.txt file created in a previous lab and redirect the sort to a new file called sorted_supplies.txt sort -n supplies.txt > sorted_supplies.txt Provide a screenshot showing successful completion of this task. Your screenshot below: Task 18 The paste command pastes 2 or more files side by side. Use the following command to paste the office.txt file (created in a previous lab) on the left and the sorted_supplies.txt file to the left. paste office.txt sorted_supplies.txt Provide a screenshot showing successful completion of this task. Your screenshot below: Task 19 The join command is similar to the paste command however it does it in a different way. Join associates data similar to a database and combines lines based on a shared field. For instance, the office.txt lists names of members of The Office and assigns them a number (i.e Jim is 1, Dwight is 3). The sorted_supplies.txt also has an assigned number or key for each supply item (i.e. stapler is 1, nunchucks is 3). Join will associate each member of the office with the supply item that has the same number or key. For example, Dwight which is number 3 will be paired with nunchucks which are assigned the same number. Each text file needs to be sorted for join to work with the expected outcome. Use the command below and answer the following questions. join office.txt sorted_supplies.txt Based on the output of the above command, What supply was associated with angela? Which supply was associated with creed? Which supply was associated with pam? Michael? Your answer below: Task 20 Create a file called list.txt with the following content. list.txt file 1%ron%directory%Parks Dept 2%leslie%duty director%Parks Dept 3%andy%shoe shiner%staff 4%li'l sebastian%mascot%Mini Horse 5*april*intern* Parks Dept 6*tom* associate* Parks Dept INFO 1111: Linux INFO-1111: LINUX 11 7*tammy* pure evil*Library Dept 8*shauna*reporter* The Pawnee Journal Task 21 The cut command is used to cut columns from files separated by a delimiter. A delimiter is a character that is used to separate fields. Notice in the list file created in task 20 that each field (column) the first 4 lines are separated by a %. In lines 5 through 8 each field is separated by a * To display only the 2 field for the first 4 lines using the delimiter %, use the following command: cut -d% -f2 list.txt cut - the command -d - delimiter. each field (column) is separated by the % character. field. display the second (2) field. Explain why this command only worked for the first 4 lines and not for lines 5-8. Your answer below: Task 22 Use the cut command to display the 3rd field of lines 5-8 for the list.txt file. What command did you use? Your answer below: Task 25 To display multiple fields with the cut command, indicate specific fields separated by commas or a range of fields. For example, to display the 2nd and 4th column of list.txt file: INFO 1111: Linux INFO-1111: LINUX 1 cut -d% -f2,4 list.txt To display the range of fields use the following: cut -d% -f2-4 list.txt Execute the above commands and provide a screenshot showing successful completion of this task. Your screenshot below: Task 26 The /etc/passwd file contains all the users on the system. The usernames are in the first field of the file. View the top 10 lines of the /etc/passwd? What command did you use? Hint: See a previous lab. Your answer below: Task 27 After completing task 26, what character delimits (or separates) each field (column) within the /etc/passwd file? Your answer below: Task 28 Use the cut command to display only the first field of the /etc/passwd file. Please provide a screenshot showing successful completion of this task. Your screenshot below: INFO 1111: Linux
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started