Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

questions unix, help using putty. **please show work using a program** with all questions answered (if possible), I'll rate. so I can Have a understanding

questions unix, help using putty. **please show work using a program** with all questions answered (if possible), I'll rate. so I can Have a understanding really helps

Commands to study to answer this question: tail, head, cmp, diff, comm, uniq, touch,

umask, grep, vi, cat, ls, and echo

Two files can be compared usingcmpcommand anddiffcommand depending on requirements.

In order to do this question, create two files with 12 or more names with one name in each line. Make sure that some names in the two files are same and some are different. Ensure that there are few consecutive lines with identical names (duplicate lines) in each file. Also, make sure that some of the names are the same in both files.

Create these two files before issuing the script command to answer this question.

1) Display the content of each file, one at a time

2) Compare the two files usingcmpcommand

3) Find the differences between usingdiffcommand

4) Sortfirst file and store the result by redirecting the output to a file as sorted

5)Sortsecond file and store the result by redirecting the output to another file as sorted

Two files can also be comparedcommcommand. There are differences betweencmp,diffandcommcommands. Read about them and understand the differences.

6) Compare the two sorted files usingcommcommand

7) Display ONLY the bottom 5 lines of the first file

8) Display the top few lines of the second file using the default line count, that is, without using any option in the command. Count and find how many lines it displays by default

9) Issue appropriate command to display the content of first file removing consecutive duplicate lines

10) Create the file hw2before_setting_umask usingtouchcommand

11) Theumaskcommand can be used to set or change the default file permissions to be set when a new file is created. Issueumask 600command

12) Create the file hw2after_setting_umask usingtouchcommand

13) Display the file permissions set on hw2before_setting_umask and hw2after_setting_umask

14) Using echo command answer what permissions were removed for the owner due to the above umask command

The grep command can be used to search for a string in one or more files. When the line with the string is found, it is displayed. Check this by issuing the following grep commands.

15) Issue agrepcommand on hw2test1 with a name that exists in hw2test1.

16) Issue agrepcommand on hw2test[12] with a name that exists in both files (hw2test1 and hw2test2).

17) Issue agrepcommand on hw2test[12] with a name that does not exist in both files.

18) What difference you see between (16) and (17) by Observing the output of above three grep commands

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Refactoring Databases Evolutionary Database Design

Authors: Scott Ambler, Pramod Sadalage

1st Edition

0321774515, 978-0321774514

More Books

Students also viewed these Databases questions