Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
Code Block
titleThe Power of the Command Line
$ whoami
$ date
$ date +%T
$ date +$Y
$ cal
$ emacs -nw -f tetris
up arrow rotates
left right arrows move
quit: ctrl-x, ctrl-c
to quit: hold control and x then hold control and c
$ clear
$ history
Code Block
titleIn the valley of echos
$ echo Science!
Science!
$ echo "Your username is $USER"
Your username is dff2106
$ echo $HOSTNAME
banana
$ echo $OSTYPE
solaris2.7
$ printenv
Code Block
titleMake your own variables!
$ myname="David"
$ echo $myname
David
$ echo "My name is $myname"
My name is David
Code Block
titleIt can do math!
$ echo 2 + 3
2 + 3
$ echo $((2 + 3))
5
$ mynumber=72
$ echo mynumber
mynumber
$ echo $mynumber
72
$ echo $mynumber / 9
72 / 9
$ echo $((mynumber / 9))
8
Code Block
titleLet's write some code!
$ {
> echo "Welcome to the countdown."
> now=$(date +%T)
> echo "The time is now $now"
> echo "Hit return to ignite."
> read
> echo 3
> echo 2
> echo 1
> echo Blastoff!
> }
Code Block
titleUse an editor to write better code!
$ ed
a
echo "Hi, what is your name?"
read name
echo "Hi $name I am $HOSTNAME"
echo "What year were you born?"
read year
now=$(date +%Y)
age=$((now - year))
echo "Ah, $year, that was a good year."
echo "So that makes you $age years old."
.
wq myfirstcode
$ bash myfirstcode
Code Block
titleYou can go online!
$ telnet towel.blinkenlights.nl
Watch star wars!!
to quit: ctrl-] then type 'quit'
Here we will write a simple code in with ed editor.
Maybe use curl on some data
google supernova data filetype:txt for inspiration
http://supernova.lbl.gov/Union/figures/SCPUnion2_mu_vs_z.txt
OR GET SDSS DATA
example: http://dr9.sdss3.org/spectrumDetail?plateid=1646&mjd=53498&fiber=41
head tail cat
more less
ed
grep
awk $2 $5
Code Block
titleNavigating the Filesystem
$ echo $HOME
/u/10/j/jf2663
$ echo $SHELL
/bin/bash
bash is not only program but also an interactive shell to your computer!
$ pwd
$ ls

Maybe use ed to create alias and/or new bash command for tetris

Code Block
titleLogging Into Columbia Unix (CUNIX)
$ ssh uni1234@cunix.cc.columbia.edu
$ lookup Bollinger

Cunix Guide