User:Konrad U Foerstner/Introduction to the Unix shell

From OpenWetWare

Jump to: navigation, search

Contents

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
  • tr
  • 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.

man page

ls

list directory contents

man page

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)
Personal tools