If, at any time, somebody says "X is hard to remember": alias
.
Always show the command in the most useful 1-3 contexts, with the most usual flags.
######Assuming Ubuntu:
- opening a terminal,
echo
,rev
,tac
- computers can do things we can't:
factor 345354699
- where's my stuff?
find ~/Downloads -name "*Frozen*mp4"
- what's running?
ps aux | grep chromium
,htop
- stopping/pausing things: ctrl+
C
, ctrl+D
, ctrl+Z
,jobs
,fg
killall firefox
,xkill
,kill -9 process.id.you.looked.up
date
,cal
tr
,sed
(simple examples)w3m gawker.com #no ads
= comments- ctrl+
R
, ctrl+W
, ctrl+A
, ctrl+E
, alt+F
, alt+B
- ctrl+shift+
V
, ctrl+shift+C
!!
,!$
, alt+.
,tab
\n
,\t
crontab -e
seq 111 151 | factor
seq 12211 12251 | factor
seq 1225511 1225551 | factor
- how long does it take for things to get slow?
seq 11111111111111111 11111111111111151 | factor
sudo service status-all
(mysqld
, X) : background processesnc
: open one connection, listen = interprocess communication (kernel)- (maybe a niftier example? eg have
nc
factor whatever number the other side inputs?) history | grep find
(what's the syntax for thatfind
command again?)eog image.jpeg &
= backgroundingpdftotext
, OCR, …gedit /etc/some.config.file.rc &
= backgrounding, text files let you customise your system
apt-cache search games
apt-cache search games | grep chess
= pipes, grepsudo apt-get install __
= whatever they want
curl
, httpbin.orgssh
,ssh [email protected]
,ssh -i secuity.pem -c blowfish [email protected]
curl checkip.amazonaws.com
ping google.com
= simpler message than HTTP orcurl
traceroute google.com
= where the internet goes physicallytraceroute 127.0.0.1
= right heretraceroute 10.0.0.1
= your wireless servertraceroute 192.168.1.1
- some SimpleHTTPServer locally (
nc
again?echo "boo" | cat | nc -v -l 12345
, then navigate to127.0.0.1:12345
andlocalhost:12345
) - post a form with
curl -F
? = how spam works
ls /
,ls /usr/bin/
,ls /usr/local/bin
,ls /usr/sbin/
,ls /usr/bin/
,ls /proc
,ls /dev
ls -R ~/.config/
gem install bro
= people can write tools for you in python, ruby, perl, as well as c—and you don't have to care which one.bro tar
sudo apt-get install build-tools
cd /opt && wget http://place.org/files/something.tar.gz && tar -xzvf something.tar.gz && cd something && ls -oh && ./configure && make && make install
wget TTYtter.perl; ls -oh; chmod u+x TTYtter.perl; ls -oh; perl TTYtter.perl
man sprintf
= built on C
This is open-source = chaotic, sometimes anachronistic: tape archives, pseudo-tty's, \bel
ls, ports; curses, bootloaders, nroff, alpine. Linux was written in C because it was an easy language at the time. (Even physicists could learn it.) It predates screens/monitors.
wicd-curses
,ifconfig
sed
,grep
,tr
. Unix for poets. (And another thing computers are way better at than people.)pip install csvkit
- first few
hg
commands (init, add, commit, commit, view tree, commit, undo, un-undo, share w/ colleagues, track their changes) - Broman's "minimal
make
" = idea of reproducibility - upload static site to S3 (
s3cmd
) - backup to glacier
- ELK
- ruby koans (test-driven development), @dancow tutorial on webscraping
- databases, csv's, JSON
jq api.forecast.io
- curl quandl
tmux
/screen
xargs
dd
,shred
export
,set
nohup
,sigint
,sigkill
,trap
- ctrl+shift+U,
gucharmap
- https://github.com/jlevy/the-art-of-command-line
######Assuming Mac: