Home > less > less -j is not working for me

less -j is not working for me

May 13Hits:1
Advertisement

less -jn where n is a line number to jump to is not working for me. It just has no effect. I'm running less version 436 on Ubuntu 11.04. I also tried less --jump-target=200 and LESS='-j200' less filename.

Answers

ceving's answer explains what -j does. I think you're looking for

less +200 filename           # jump to line 200 (the first line is 1)

The +NUM switch to jump to line NUM is fairly common amongst unix text viewers (starting with more) and editors. In less, it's an instance of the more general +command which lets you execute a command automatically after opening the file. Other common examples:

less +200P filename          # jump to the line containing byte 200
less +G filename             # jump to the end of the file (G command)
less +/hello filename        # jump to the first occurrence of hello

Tags:less

Copyright (C) 2017 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 13 q. 0.362 s.