LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-20-2015, 03:20 PM   #1
mescu
LQ Newbie
 
Registered: Jul 2015
Posts: 9

Rep: Reputation: Disabled
Post Command less - useful keys


Is there a particular order in which search keys should be used in command less?
I mean n, space, /string and q (quit).

Thanks!
 
Old 07-20-2015, 05:47 PM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Yes, there is. It depends on what you want to do.

To quit, type q. No other command necessary.
To search for blah, type /blah. After that, type n for the next ocurrence of blah.
To scroll down one page, type space.

If you first want to search for blah, then see the next page, then search for blah again: /blah<enter key><space>n
If you want to see two pages, then search for blah, then end the less command: <space><space>/blah<enter key>q
 
1 members found this post helpful.
Old 07-20-2015, 08:36 PM   #3
Sefyir
Member
 
Registered: Mar 2015
Distribution: Linux Mint
Posts: 634

Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316
Hit h while in less to see the various less commands.
It follows a vi style of navigating.
 
1 members found this post helpful.
Old 07-26-2015, 06:32 AM   #4
simotrone
LQ Newbie
 
Registered: Aug 2010
Location: Internet
Distribution: Debian, Slackware, and other...
Posts: 22

Rep: Reputation: 4
Another interesting key in less is "F": you'll follow the file (log) while it changes. It is similar to tail -f.

About the search:
"n" to search next word
"N" to search previous word
 
  


Reply

Tags
linux, linux command


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Finally Got SSH Keys to Work, Had to Use a Different Command...WHY? JockVSJock Linux - Newbie 7 01-29-2015 05:13 PM
SFTP command uses different keys depending on where it's run Phaethar Linux - Software 3 06-11-2014 04:46 PM
Running command with Fluxbox keys. Abbaddon Linux - General 7 11-02-2012 09:34 PM
How can I append to a file remotely using a linux command (via ssh keys) abefroman Programming 2 11-27-2009 09:51 PM
mouse keys as modifier keys (ctrl & alt) belda Linux - Desktop 3 06-25-2009 10:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration