Making your day as a developer better

one (or two) command lines at a time

Basic shell

above ls, and cd, these commands will become invaluable.

!!

essentially do that again…

ctrl-a

go to the beginning of the command line

sudo !!

do that again with sudo

history

look at what you’ve done

!98

rerun command 98 from your history

GIT

Everyones favourite version control, the backbone of everything.

Safe, worry free git pulls.

git fetch
git diff origin/master

then once you’ve seen whats coming down the wire

git pull

Sorting and piping and grepping and counting

I use this a surprisingly large amount of the time

sort | uniq -c | sort -n -k1 | head

to make sense of data.

lets say you’ve got a list of urls in urls.txt

cat urls.txt | sort | uniq -c | sort -n -k1 |head

gives you the top 10 most frequent urls in that file.

sort the list, then count uniques, sort numerically by the first col (where unique puts its count) then just take the top 10.

Show your support

Clapping shows how much you appreciated tim marsh’s story.