file.txt contains:
white
green
blue
foo
red
black
bar
yellow
Hope this helps!!! Read more ...
sed '/foo/,/bar/{d;}' file.txt
Output:white
green
blue
red
black
yellow
my views
file.txt contains:
white
green
blue
foo
red
black
bar
yellow
Hope this helps!!! Read more ...
sed '/foo/,/bar/{d;}' file.txt
Output:white
green
blue
red
black
yellow
I had a situation where I had to find and replace in files with out creating new files and renaming them back, so after some research on Google I came up with this:
find . type –f | xargs perl –pi –e 's/foo/bar/g'
find . -type f | xargs grep foo
-i for ignore case Read more ...
find /usr/home/akt -type f | xargs grep -i foo