Command | useful for | bad if |
---|
head | seeing the first lines of a file (10 by default) | file is binary | tail | seeing the last lines of a file (10 by default) | file is binary | cat | print all lines of a file to the screen | the file is big and/or binary | less | opens the entire file in a separate program but does not allow editing | if you are going to type a new command based on the content, or forget the q key exits the view, or file is binary | more | prints 1 page worth of a file to the screen, can hold enter key down to see next line repeatedly. Contents will remain when you scroll back up. | you forget that you hit the q key to stop stop looking at the file, or file is binary |
Note that all of the above state that it is bad to view binary files. Binary files exist for computers to read, not humans, and are thus best ignored. We'll go over this in more detail as well as some conversion steps when we deal with .sam and .bam files later in the course. Tipwarning |
---|
Many expect to see something that looks like something out of The Matrix, but unfortunately, you actually just see a bunch of gibberish and it can mess with your terminal. Typically if you accidentally or unknowingly try to view such a file, its best to just close your terminal window and start a new session. |
|