Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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.