Showing posts with label sed. Show all posts
Showing posts with label sed. Show all posts

Thursday, July 3, 2014

To Remove/Delete Nth line from a Big File

To remove 100th line from a file.
sed -e '100d' oracle.log > oracle_new.log

To remove lines between 100-110 from a file.
sed -e '101,111d' oracle.log > oracle_new.log

To view the content of Nth(200) line in a Big File

Method 1:
oracle=>head -200 filename | tail -1



Method 2:
oracle=>sed '199p;200q;d' filename