10 Most Used Linux Commands

Whilst skimming my Bash history today looking for an esoteric one liner I’d written earlier I started to ponder what my most used commands were, it’s easy enough to find out! This is actually output from my Mac, not a Linux box, I tricked you 😀 Chill:~ rus$ history | awk {‘print $2’} | sort […]

Bash Shortcuts

Meta-< -> go to beginning of history file Meta-> -> go to end of history file Meta-f -> go to next word in command line Meta-b -> go to previous word in command line Meta-d -> delete next word in command line (from the actual position of the prompt) Ctrl-a -> go to the start […]

Changing variables in a BASH while loop

There is an error that I often run in to when working with files and while loops in BASH. Often I have scripts similar to the following, where I cat a file and read it in using a while loop to process variables in the file: #!/bin/bash count=0; cat testfile | while read line do […]