IT 244: Introduction to Linux/Unix
Answers to Class 5 Ungraded Quiz

  1. What would you type at the command line if you wanted to see the value of the variable SHELL?
    echo  $SHELL
  2. What would you type at the command line if you wanted to know the network name of the Unix computer you were using?
    hostname
  3. Name one of the two pager programs that allow you to read a long file one screenful at a time.
    more or less
  4. If you started typing the name of a file on the command line and wanted Unix to supply the rest, what would you do?
    hit the Tab key
  5. What would you type at the command line if you wanted to find all lines in the file results.txt that contained the word "homework"?
    grep  homework  results.txt
  6. What would you type at the command line if you wanted to find all lines in the file results.txt that DID NOT contain the word "homework"?
    grep -v homework  results.txt
  7. What would you type at the command line if you wanted to see the FIRST 10 lines of the file log.txt?
    head  log.txt
  8. What would you type at the command line if you wanted to see the LAST 10 lines of the file log.txt?
    tail  log.txt
  9. What would you type at the command line if you wanted to see all the lines in the file results.txt in sorted order?
    sort  results.txt
  10. What would you type at the command line if you wanted to see all the lines in numbers.txt sorted in REVERSE NUMERIC order?
    sort -nr numbers.txt