Describe the result of executing the grep command


Discuss the below in detail:

1) Describe the result of executing each of the following grep commands.

a. grep -c ill memo
b. grep -n ill memo

2) Rewrite the following sequence of commands using sort as a filter. The end result should be a single command line when you are done.

sort roster > temp
lp temp
rm temp

3) Write a command to list all files in current directory, that:

a. Start with the letters b or f.
b. Start with the letters a through k.
c. Have a capital letter anywhere in their name.

4) What is the difference between the following commands?

cat xyz[12]
cat xyz[1-2]

5) Listing for which files will be given by the following command?

ls -l file[1-20]

6) Write a Bash script that will prompt for the user's first and last names and store the responses in two variables. Then it will display the stored information in the format "You entered lastname, firstname." and ask the user for confirmation. If the answer is "y" or "yes", then say "Thank you!", and if the answer is "n" or "no" then start again with the prompts.

Solution Preview :

Prepared by a verified Expert
Programming Languages: Describe the result of executing the grep command
Reference No:- TGS01932128

Now Priced at $20 (50% Discount)

Recommended (96%)

Rated (4.8/5)