Friday, December 16, 2011

Small tricks for tab-delimeted files

Working on my current project includes a lot of manipulation with tab-delimited files (SAM,GFF, etc) Here are some nice tricks to remember.

Output only second field of a delimited file:
cat samout | cut -f 2

The same with awk:
awk '{print $2}'

Not related to tab-delimited files but still very useful :)

Compare two files based on their content:
cat file1 file2 | sort | uniq -u

Tuesday, November 8, 2011

Linux BASH tricks: recovering items

Very nice commands to know about

Run the last-command name: !!
Recover last entered item: Alt + "."
Search over history: Ctrl + R