DataScience Workbook / 07. Data Acquisition and Wrangling / 1. Remote Data Access / 1.3 Remote Data Preview without Downloading / 1.3.1 Viewing Text Files using UNIX commands
Introduction
Many times the results generated by the bioinformatics programs are either simple text files (tab/comma seperated), pdf files or in some rare cases png/jpeg files. Here we will show you how to view these files without having to download them locally to your machine.
Text files
The text files are the easiest. You can use any of the standard UNIX commands to view them. There are many commands for this purpose such as:
Command | Purpose | Example | Use cases |
---|---|---|---|
less |
view file pagewise with more options | less filename |
use -S to avoid line wrapping, you can use arrow keys to scroll |
more |
view file pagewise | more filename |
use less instead |
cat |
catalogs the contents of a file | cat filename |
you can send the contenst of a file to clipboard or to another file using this command |
tac |
reverse of cat, reverses the order of lines | tac filename |
pipe this to less commad to scroll through the file in reverse |
head |
view first few lines of a file | head filename |
use -n option to change the number of lines displayed. -n 20 displays 20 lines |
tail |
view last few lines of a file | tail filename |
use -n option to change the number of lines displayed. -n 20 displays 20 lines |
od |
octal dump of a file | od filename |
use-c options and pipe it through less. You can see non printable characters with this option (like tab, whitespace, newline etc) |
Further Reading
- 1.3.2 Viewing PDF Files using X11 SSH connection
- 1.3.3 Viewing Graphic Files using ASCII art in the termianl
- 2. Data Manipulation
- 3. Data Wrangling: ready-made apps