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

Assisting Tutor

Related Homework Solutions

System Calls in Linux
Homework Solution
$25.00
Computer Science
Linux
File Management
Lab Notes
System Calls
Buffer
Reads
Writes
Algorithms
Codes
Scripts
Input
Output
Errors
Arguments
Results
Linux Scripting Final Task
Homework Solution
$58.00
UNIX
Command
Find
Hosts
Pipe
Grep
Passwd
Csh
Cd
Link
Blink
Symbolic
Mailx
PID
Process
Lpsched
Root
Awk
Smcgowan
Usr
Bin
Programming Questions
Homework Solution
$65.00
Programming
Computer Science
Parent Processes
Codes
C++
Linux
Fork
Child Processes
Code Segments
Ordinary Pipes
Strings
Messages
UNIX
Web Servers
Basic Mutex
Bank Accounts
Functions
SJF Algorithm
Three Simple Shell Scripts
Homework Solution
$15.00
Shell
Bash
Script
List
Directory
Lsdirs
Sh
File
See
Wordlen
Type
Long
Word
Test
Read
Wc
Argument
Bourne
Get help from a qualified tutor
Live Chats