Linux Class Week Oct 29 - Nov 2 2018 EXERCISES
Exercise 1
Explain step-by-step the commands as well as their output:
ls -l | grep -v '^d' | wc -l
Exercise 2
Assume the file SequenceFile. The file contain DNA sequences and their names. For every entry the format is:
>NAME
ACGTATACCACA
Answer the following questions:
- How many sequences exist?
- How many sequences contain at least one time the motif ACCA
- How many sequences are obtained from modern humans (hg19)
- How many sequences are obtained from the following primates (hg19 or panTro4 or ponAbe2)
Exercise 3
Create a folder called bin2 in your home directory. Add the folder bin2 in your PATH. Create a script that will find out how many files or directories in a folder start with an 'A' (either small or capital) and put it in bin2. Execute the script in some folders and demonstrate that it works properly.
Exercise 4
Assume the file ExpressionData.
- Output only its second column.
- Output its second and fourth column.
- Use awk (google it), to print the sum of the second and the fourth column.
Exercise 5
- obtain a list of all PDF files
- obtain a list of all PDF files that contain the word microsat (case insensitive)
- obtain a list of all PDF files taht contain the word microsat (case sensitive)
Exercise 6
- use the command find (if you don't know it, just google it) to find all files with the suffix '.txt' that are contained in your home folder