Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 11 down vote accepted

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
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.