Neon Rocket

Even Neo is Impressed

RSS 2.0

command-line magic

Bulk fix a list of words to the proper case

Problem Given a long list of upper-case words (one word per line), such as: MARY JOE SCOTT FRED … (for thousands of rows) … You want to change this to Mary Joe Scott Fred (etc) Solution Use perl from the command line. Assume all your names are in a file called ‘names.txt’. We’re going to send the output to a …Continue reading →

What are your top commands?

Sometimes it is interesting to navel-graze. What commands do you type the most? history | awk ‘{a[$2]++}END{for(i in a){print a[i] ” ” i}}’ | sort -rn | head Here’s mine: 95 ll 93 git 67 cd 37 vi 29 identify 15 find 12 agvtool 11 history 11 exit 10 cat “ll” is an alias for ls -l Interesting that I’ve …Continue reading →