Thursday 28 November 2013

Going back to a previous directory in the Linux terminal

 A little cd trick to cd back in Linux terminal history:
 cd -  

So useful I had to share!

Wednesday 27 November 2013

Adding Syntax Highlighting to Linux less

Install source-highlight:
 sudo apt-get install source-highlight  

Add the following two lines to~/.bashrc
 export LESSOPEN="| /usr/share/source-highlight/src-hilite-lesspipe.sh %s"  
 export LESS=' -R '  

Now source files opened with less will be nicely syntax highlighted. source-highlight supports many languages - see
 source-highlight --lang-list  
for a full listing.