The first command causes echo to display the characters c, a, and t on the screen. The second command uses cat to copy the contents of a file named echo to the screen. If there is no file named echo, cat displays an error message.
What will be an ideal response?
You can either decompress the file using gunzip, giving the same commands
as in exercise 5 once the file is decompressed, or use zcat and a pipeline to
display the results without creating an intermediate file:
$ zcat phone.gz | grep "Ace Electronics"
$ zcat phone.gz | sort
$ zcat phone.gz | uniq
$ zcat phone.gz | sort -u
Which technique you use makes a significant difference only if phone.gz is
large, in which case it becomes an issue of what you are doing and making
a tradeoff between using more CPU (processor) time and less hard disk stor-
age, or vice versa.
When you are giving a single command one time only, using a pipeline is
more efficient. When you want to give more than one command or want to
give one command repeatedly, it is more efficient to decompress the file once
using gunzip and then process it repeatedly with grep, sort, or uniq, assuming
you have sufficient disk space. The most inefficient technique as far as disk
space goes and the most efficient as far as CPU (and your) time goes is to
redirect the output of grep, sort, or uniq to new files:
$ zcat phone.gz | sort > phone.sort
You might also like to view...
A digital signature is authenticated by the:
A) source of the signature. B) file of the signature. C) target of the signature. D) name on the signature.
Ben's job is to ensure that data is labeled with the appropriate sensitivity label. Since Ben works for the US government, he has to apply the labels Unclassified, Confidential, Secret, and Top Secret to systems and media. If Ben is asked to label a system that handles Secret, Confidential, and Unclassified information, how should he label it?
A. Mixed classification B. Confidential C. Top Secret D. Secret