Unix Basics Review

Common Commands

Command Function
ls list contents
cd change directory
mkdir make a directory
rm use caution, it is easy to delete more that you would like
head prints the top few lines to the terminal window
tail prints the last few lines to the terminal window
sort sorts the lines
uniq prints the unique lines
grep filnds the lines that contain a pattern
wc counts the number of lines, characters and words
mv move files
cp copy files
date returns the current date and time
pwd return working directory name
ssh remote login
scp remote secure copy
~ represents your home directory
man [command] manual page for the command

text editors

  1. emacs
  2. vi
  3. vim
  4. nedit
  5. nano

Unix Problem Set

>seqName description ATGGCGTCTTGGCCTTAAAAGCTC

Commands to try

ls -l ls -lt

You can string more than one command together with a pipe (|) , such that the output of the first command is received by the second command.

ls -lt | head

You can string more than one command together with a semi-colon (;) , such that the commands run sequentially, but that output does not get passed into the next command.

date; some program command ; date

You can redirect the output of a command into a file

grep PATTERN > PATTERN.txt

You can append the output of a command to a file

grep PATTERN2 >> PATTERN.txt

You can redirect stderr to a file

command 2> filename

You can redirect the output (stdout) and stderr to a file

command &> filename