Skip to content

Instantly share code, notes, and snippets.

@plexus
Created July 1, 2013 20:04
Show Gist options
  • Save plexus/5904069 to your computer and use it in GitHub Desktop.
Save plexus/5904069 to your computer and use it in GitHub Desktop.

History

Unix

early 70’s by Bell Labs (AT&T)

first OS not written in assembly (Ken Thompson & Dennis Ritchie)

not commercial (decree from 1956), was licensed with source

1983

I was born

AT&T made Unix commercial

GNU was born

Stallman/FSF

GNU’s not unix

Kernel?

1991 Linux

1993/1995 Ruby!

1997 Cathedral and the Bazaar

Tim O’Reilly / ESR rebranding

1998 Netscape goes open source

Philosophy

KISS

Do one thing well

Modularity

Composition

“Write programs that do one thing and do it well. Write programs to work together. Write programs to handle text streams, because that is a universal interface.”

navigating

pwd

cd

ls

ls -a

ls -l

unix file system

/ root

. and ..

chmod / chown

mount

getting help

man

apropos

–help

which

environment variable

set

export

$FOO

getting interesting

mkdir

rmdir

cat

echo

rm

piping and text stuff

head

tail

grep

wc

sed

sort

uniq

sed

scripting

shebang

sourcing vs scripts

process controll

C-z

&

fg / bg

examples : vim, tail -f

shorthand/tricks

!!

!$

C-r

exercises

count number of lines in ruby project

solutions

find . -name ‘*.rb’ | xargs cat | wc -l

Sources

general interest

In the Beginning was the Command Line, Neil Stephenson

The Art of Unix Programming, Eric S. Raymond

Shell

http://cli.learncodethehardway.org/book/, Command line Crash Course, Zed Shaw

notes

pwd ls cd df

ls –all -l (only linux) ls -a -l ls -al

alias ll=’ls -al’

owner group all rwx rwx rwx 421 421 421

r– = 4 -w- = 2 –x = 1

r-x = 5 rwx = 7

20:44:43
$AAA
alias gc='git commit'
alias ll='ls -al'
alias woman=man
apropos count
apropos print
apropos puts
apropos time
apropos time | grep date
apropos time | grep date | less
apropos time | grep date | wc -l
apropos time | less
apropos time | wc -l
bash
bash what_time_is_it
/bin/ls
cat howl.txt
cat howl.txt| grep door
cat howl.txt| head -20
cat howl.txt | less
cat howl.txt | sed '/I/d' | less
cat howl.txt | sed 's/^ */===/' |less
cat howl.txt | sort | less
cat howl.txt| tail
cat what_time_is_it
cat what_time_is_it.rb
cd
cd
cd -
cd /
cd .
cd ..
cd ..
cd ~/github/speakerinnen_liste
cd ~/.rubies
cd ~/.rvm
cd scripts
chmod 700 what_time_is_it
chmod o-x what_time_is_it
chmod o+x what_time_is_it
chmod u-x what_time_is_it
chmod u+x what_time_is_it
chmod -x dir
chmod +x what_time_is_it.rb
chruby rbx
chruby ruby-1.9
clear
curl http://sprayberry.tripfwefod.com/poems/howl.txt | wc
curl http://sprayberry.tripod.com/poems/howl.txt 2>&1 | less
curl http://sprayberry.tripod.com/poems/howl.txt 2>/dev/null | wc
curl http://sprayberry.tripod.com/poems/howl.txt >> /dev/null
curl http://sprayberry.tripod.com/poems/howl.txt >> /dev/null | wc
curl http://sprayberry.tripod.com/poems/howl.txt > howl.txt
curl http://sprayberry.tripod.com/poems/howl.txt | less
curl http://sprayberry.tripod.com/poems/howl.txt | wc
curl -L https://get.rvm.io | less
curl -L https://get.rvm.io | wc -l
date +%H
date +%H%M
date +%H%m%s
date +%H:%M:%s
date +%H:%M:%S
date +%H:%M:%S >> what_time_is_it
echo $AAA
echo date +%H:%M:%S
echo date +%H:%M:%S >> what_time_is_it
echo 'fooo' >> howl_new.txt
echo 'Hello!' >> howl_new.txt
echo $PATH
echo 'puts Time.now'
echo 'puts Time.now' | wc
echo 'puts Time.now' >> what_time_is_it.rb
echo 'puts Time.now' >>! what_time_is_it.rb
echo 'xxx' >> dir/xxx
echo 'xxx' >>! dir/xxx
en ~/.zsh/.zhistory
export AAA=7
export AAA=ls
export PATH=$HOME/scripts:$PATH
find -d -name dir
find -e dir
find |grep 'bin/ruby'
find -name bin/ruby
find -name ruby
find / -type d -name bin
find -type d -name dir
find -wholename 'bin/ruby'
grep date
grep date what_time_is_it
head -20 howl.txt
head howl.txt
history
history -?
history | grep rails
history | grep rake
history --help
history | tail
irb
less howl_new.txt
less howl.txt
ls
ls
ls
ls /..
ls -a
ls -al
ls bin
ls dir
ls -l
ls -la
ls /usr/bin
man bashrc
man .bashrc
man cut
man date
man history
man less
man lightdm
man wc
mkdir dir
mkdir script
mkdir scripts
rm -rf dir
rm -rf script
ruby ./what_time_is_it.rb
ruby what_time_is_it.rb
scripts/what_time_is_it
sed 2d -i what_time_is_it
sed '/I/d' < howl.txt > howl_new.txt
tail -f howl_new.txt
tail -f /var/log/syslog
tail -f /var/log/syslog
tail howl_new.txt
touch what_time_is_it
vi .bash_profile
vi .bashrc
vi .profile
vi script/what_time_is_it
vi what_time_is_it.rb
vi .zsh/.zshrc
./what_time_is_it
what_time_is_it
./what_time_is_it.rb
which bundle
which gem
which history
which ruby
which wc
woman less
woman more
xclock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment