Question

0. The file "cards" contains the following columns in the order stated:
    YEAR    CARD_NUMBER      PLAYER_NAME    QUANTITY_AVAILABLE    TEAM

1. Sort the file ~smcgowan/Cyber/Unix/Data/cards according to the 2nd column in reverse order.
A) What sort command did you use?
B) What was the last line of output from the sort command?

2. Sort the file ~smcgowan/Cyber/Unix/Data/cards according to the 2nd column and resolve ties using the 3rd column.
A) What sort command did you use?
B) What was line 31 of the output from the sort command?
C) How would you put just line 31 on standard out?

3. You want to make a list of all the lines from the file ~smcgowan/Cyber/Unix/Data/cards that do NOT represent Mickey Mantle cards.
A) What is the grep command you would use to accomplish this?
B) How many different cards (lines) are in this list?

4. You want to list all the cards that are yankees. So you want to print all the lines that end in 'Yankees' or 'yankees'.(Note here that "print" does not mean to send to a printer. "Print" is a term used with awk by us UNIX types to mean "write to stdout")
A) What grep will get this done?
B) How many different cards (lines) are in this list?

5. Math-heads often use the ^ to represent exponentiation. You need to find all the lines that have a^2 ("squared") in the file ~smcgowan/Cyber/Unix/Data/equations.
A) What grep command would you use?
B) If you save the output from this grep to a file, what is the size (in bytes) of the file?

Solution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

1. A)
Answer:
$sort -r +2 -3 ~smcgowan/Cyber/Unix/Data/cards...

This is only a preview of the solution. Please use the purchase button to see the entire solution

$18.00

or $1 if you
register a new account!

Assisting Tutor

Related Homework Solutions

Get help from a qualified tutor
Live Chats