Wednesday, June 27, 2018

View a very long line in unix terminal using VIM editor

Steps to view a very long line in vim

  1. Open the file in vim
  2. Goto very long line
  3. write that line to temp file
  4. exit vim
  5. cat that temp file
Commands
  1. vim my_log_file.log
  2. :2345
  3. :2345w /tmp/very_long_line.txt
  4. :q!
  5. cat /tmp/very_long_line.txt

No comments:

Post a Comment