1

I would like to use ack and have the results shown one page at a time.

I've already tried to pipe it to |more, but this removes the color formatting. I would like to keep the colors intact.

Andy Lester
  • 91,102
  • 13
  • 100
  • 152
mangesh
  • 100
  • 5

2 Answers2

2

if you read man page of ack, you will see there is an option --pager for your needs. for example:

ack --color --pager=more ....
Kent
  • 189,393
  • 32
  • 233
  • 301
  • Thank you Kent. I totally missed that. However, I'm getting some strange output: ESC[1;32mItCommon/Config/cdpdr.iniESC[0m ESC[1;33m18ESC[0m:ESC[30;43mmemcacheESC[0m = 10.133.182.11:11211:1ESC[0mESC[K – mangesh Mar 26 '14 at 21:53
1

Add --color to your call to ack.