David Dakota Blair

Table of Contents

  1. About
  2. Fun bash one liners
  3. Readings:

About

This is Dakota's tilde.club page.

Preferences


Fun bash one liners

Remove all tab characters
tr -d '\t'
Find lines containing literal tabs
awk '/\t/'
grep -P
Join files using a tab separator
join -t $'\t' file1 file2
A simple awk for isolating columns
awk '{print $2}'
Simple system benchmarks
yes | sed '=' | sed '/y/d'
time seq -n 1e6
Print a few random numbers
od -d < /dev/random | awk '{ print $2 }' | head
What shell am I using?
lsof -p $$
See which processes are listening to a $PORT
netstat -pntl | grep $PORT # linux
lsof -nP -iTCP:$PORT | grep LISTEN # os x
Useful flags for rsync
rsync -h --progress --stats --verbose
Recover files from a slightly corrupted tar archive
cpio -ivd -H tar < file.tar

{{readings}}