QuestionQuestion

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 PreviewSolution 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...
$14.35 for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Linux Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats