By default, grep does not highlight the keyword or the search term. Making grep highlighting the search term can make the visibility of the keyword more obvious if it hide in between the words.
Showing posts with label regex. Show all posts
Showing posts with label regex. Show all posts
2009-05-06
2009-05-05
How to search in compressed file
This is the third post talking about compressed files. This time, we will look into how to search within the compressed file, without decompressing it.
2009-04-17
vim - basics of search and replace in substitute command mode
When cleaning up some config file with hundreds of lines, browsing up and down just to find the key word can be eye dazzling, in the pungent way. :)
The good thing about vim is, it is able to find any text you want using the "Search" command (/) in the "Normal" mode (Esc twice any time).
Some of the time, we need to change the search result with a new value. Be it slight change, addition or even removal, vim is definitely up to the job. To quote a few examples :
The good thing about vim is, it is able to find any text you want using the "Search" command (/) in the "Normal" mode (Esc twice any time).
Some of the time, we need to change the search result with a new value. Be it slight change, addition or even removal, vim is definitely up to the job. To quote a few examples :
2009-03-25
sed - search & replace with variables within bash
sed is extremely helpful in search & replace text, in file & variables. Often we need to construct a list of strings together with variables. But the normal usage of sed :
e.g.
will only replace the variable $variable-name literally rather then the pre-define value. After meddling with a few more stuff, the problem lies on ...
e.g.
sed -e 's/text-to-search/string-to-replace-$variable-name/g'
will only replace the variable $variable-name literally rather then the pre-define value. After meddling with a few more stuff, the problem lies on ...
Subscribe to:
Posts (Atom)


