User:Konrad U Foerstner/Introduction to the Unix shell: Difference between revisions
From OpenWetWare
Jump to navigationJump to search
m (→Some examples) |
No edit summary |
||
Line 1: | Line 1: | ||
== Reading recommendations == | |||
* [https://www.ibm.com/developerworks/aix/library/au-unixtext/index.html Introduction to text manipulation on UNIX-based systems] | |||
Todo | Todo | ||
* man | * man |
Revision as of 12:26, 26 April 2013
Reading recommendations
Todo
- man
- apropos
- ls
- cd
- pwd
- mv
- rm
- cat
- cp
- wc
- cut
- head
- tail
- less
- top
- grep
- sort
- uniq
- du
- diff
- md5sum
- echo
- find
- tar, gzip, bz2, zip, bunzip, bzcat, zgrep ...
- tab completion
- globbing
- ssh
- screen
- pipes
- less
- parameter and arguments
- stdin, stout
- home dir ~/
- http://ss64.com/bash/
Useful commands
man
Maybe the most important command! Show the manual page of command.
ls
list directory contents
Text editors
- emacs
- vi
- gedit
Some examples
Retrieve a fasta file
$ wget ftp://ftp.ncbi.nih.gov/genbank/genomes/Bacteria/Campylobacter_jejuni_81116_uid17953/CP000814.faa
Inspect it with a viewer (leave it with "q")
$ less CP000814.faa
List all fasta headers
$ grep ">" CP000814.faa
Count the number of protein names
$ grep -c ">" CP000814.faa
Get only the accessions
$ grep ">" CP000814.faa | cut -f 4 -d\|
Count the total number of amino acids
$ grep -v ">" CP000814.faa | wc -m
Tasks
- How many hypothetical protein are in the file?
- Generate a list of their accession numbers and a list of their IDs (e.g. C8J_1629)