We want to work on a DNA project and start out in the home directory: “/home/jane”. From there, we cd into the subdirectory for our project with: “cd projects/dna”. Finally, we want to copy all files ending with “.vcf” from “/home/jane/data/genetics/” into our current directory. Which of the commands below will do the job?
- cp data/genetics/*.vcf projects/dna/
- cp data/genetics/*.vcf .
- cp ../data/genetics/*.vcf .
- cp ../../data/genetics/*.vcf .
You run a theatre company with a large subscriber base, and you want to figure out where most of your patrons live. You decide to look at the most common area codes of the phone numbers of your patrons. You export all the phone numbers in your database into a text file: “phonenumbers.txt”. This file has one phone number per line, of the form “123-456-7890″ (area code would be “123”). Arrange the following commands (each command is used exactly once) into a pipeline (separated by “ | ” characters) to output the 5 most common area codes and how often they occurred: |
- uniq -c
- sort -nr
- cat phonenumbers.txt
- head -n 5
- cut -d”-“ -f 1
- sort