Skip to main content

Posts

Showing posts from May, 2017

Find : Multiple files with different strings

Use find command for multiple search string? Yes, we can. find . -type f \( -name "*.xvg" -o -name "*.log" \) We must not forget to have space before -name  in both the above occurrences. Enable Ginger Cannot connect to Ginger Check your internet connection or reload the browser Disable in this text field Edit Edit in Ginger Edit in Ginger ×

Clear the VI highlighting

Not any thing against other editors, VI is my fav. I often use it's in-built search feature to look out for words/phrases. I often had wondered, how can the yellow highlighting be turned-off. One way to do is simply type: :noh

tail n lines for all xvg files

During our day-to-day work, we end up all files with same extension. So, if we want to output the last few lines of similar type of files, we can follow the following approach. for xvg in *.xvg; do echo $xvg;cat $xvg|tail -2 $xvg; done By default,  tail outputs last 10 lines, so we cannot use: tail *.xvg If we want the look at the 2 lines instead of 10, we can use the above one-liners.