Fun with sed on Linux.

The sed command can be used to reverse text. This is a very interesting feature. Provide a text string, and it will be reversed. jason@jason-Virtual-Machine:~$ sed ‘/\n/!G;s/\(.\)\(.*\n\)/&\2\1/;//D;s/./Hello. /’ <<< ‘This is a long sentence in reverse. This is a lot of fun.’ Hello. .nuf fo tol a si sihT .esrever ni ecnetnes gnol a si … Read more

Get a randomly generated bash shell prompt and some other tricks for the Linux shell.

A nice shell prompt that is randomly generated each time it appears. Working version. PS1="\[\e[1;31m\]$(shuf -n 1 /usr/share/dict/words)\[\e[m\]@\[\e[1;35m\]$(shuf -n 1 /usr/share/dict/words)\[\e[m\]\$ "PS1="\[\e[1;31m\]$(shuf -n 1 /usr/share/dict/words)\[\e[m\]@\[\e[1;35m\]$(shuf -n 1 /usr/share/dict/words)\[\e[m\]\$ " Select a random word from a textfile with bash. ubuntu ~ $ shuf -n 1 /usr/share/dict/words pluckedubuntu ~ $ shuf -n 1 /usr/share/dict/words plucked Select a … Read more