Question: Linux coding question- Please provide the full input and full output and perform these on putty. 3-Use grep and wc to count the number of

Linux coding question- Please provide the full input and full output and perform these on putty.

3-Use grep and wc to count the number of lines in some files that do NOT contain the word pepper. You should not use greps -c option because we want a single line of output from the command with a total line count regardless of the number of files processed at one time. Note: This will require a pipe. It will very definitely NOT require any temporary files.

4-Use find and grep to print the lines in the all the .txt files (like in the first problem) that have the word Grade in them. The output should include the name of the matching file(s) as well as the that actual matching line(s) of text. Do not number the lines. READ the man page on find. This will require the use of finds -exec and -name options. This WILL NOT require any pipes or any other utilities besides find and grep. Be careful to protect all wildcards in filenames with single quotes.

5- Use tr to modify some text so that all uppercase characters are replaced with lowercase characters. you might consider that tr can read from standard input and most versions CANNOT read text directly from files. Maybe redirection? And again, some means just that, whatever I want to give it.

6-Given some text, use sort to rearrange the text so that the lines are sorted numerically, from largest to smallest, using positions 2-6 (starting from the beginning of the line). The columns are NOT delimited by anything. I mean by that, positions on a line of the file where the character at the left margin is column 1, the next character (without any space) is column 2 and so on. This is not the same as having columns separated by spaces, tabs, commas, etc. Read carefully

Note that if sorting numerically, any line whose key does NOT contain an initial number is printed before all the lines that do have a numeric key. Those non matching lines are printed in an arbitrary order, but it will probably be as they are encountered.

In the normal numeric sort (no fields, no largest to smallest) matching lines are printed in numeric order with either the -n or -g switches. That means given

090

24sldkj

that 090 would be printed AFTER 24sldkj. This means that the entire number is considered and leading 0s are ignored.

7-Given some text, display only the third column of data, sorted (alphabetically) in ascending order. Suppress duplicate values. The columns in this one are comma separated. You will use cut and then sort for this one. Again, use a pipe.

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 Databases Questions!