Nov 252012
 

Terminal
In the past I’ve posted an article regarding the basic usage of grep, one of the commands that I use daily at work to search a text within multiple files, or a text string in the list of running process of a Linux server, but I’ve forgot to show you a small and useful option : How to colour the output that you get from grep to highlight the text you were searching for in a long line.

This is a small option of this powerful command but can save your eyes when searching for a particular property of a Java process that is 4 or 5 lines long.

To be honest I’ve realised this thanks to an article of Alessio, posted recently on his nice blog: http://dark-linux.net and so the following is the translation by me of his article in Italian with some small addition in examples and explanations.

Continue reading »

flattr this!

Sep 252011
 

Unix based operating systems like Linux offer a unique approach to join two commands on the terminal, with it you can take the output of the first command and use it as input of the second command, this is the concept of pipe or | . Pipes allow two separate process to communicate with each other also if they were not created to do it, so this open an infinite series of opportunity.

A basic example is:

ls -l | grep rwxrwxrwx

This command will print the list of all the files in the local directory that have permission rwxrwxrwx (or that have rwxrwxrwx in their name).

Continue reading »

flattr this!