...
One of the challenges of dealing with large data files, whether compressed or not, is finding your way around the data – finding and looking at relevant pieces of it. Except for the smallest of files, you can't open them up in a text editor because those programs read the whole file into memory, so will choke on sequencing data files! Instead we use various techniques to look at pieces of the files at a time. (Read more about commands for Displaying file contents)
The first technique is the use of pagers – we've already seen this with the more command. Review its use now on our small uncompressed file:
...
Code Block |
---|
language | bash |
---|
title | Using the head command |
---|
|
# shows 1st 10 lines
head small.fq
# shows 1st 100 lines -- might want to pipe this to more to see a bit at a time
head -100 small.fq | more |
The vertical bar ( | ) above is the pipe operator, which connects one program's standard output to the next program's standard input. (Read more about Piping)
Image Added
So what if you want to see line numbers on your head or tail output? Neither command seems to have an option to do this.
Expand |
---|
|
Code Block |
---|
|
|
cat
--help
Expand |
---|
|
Code Block |
---|
| cat -n small.fq | tail |
|
...