• less कमांड की विभिन्न सुविधाओं और shortcut combinations के ज़रिए file navigation, search, filtering, bookmark, option switching आदि को प्रभावी ढंग से किया जा सकता है
  • कई files को एक साथ खोलकर :n, :p, :e, :d कमांड से files के बीच move·add·remove किया जा सकता है
  • search (/, ?, n, N) और filtering (&, &!) सुविधाओं का उपयोग करके खास pattern को जल्दी खोजा या बाहर रखा जा सकता है
  • bookmark (m, ') और bracket matching सुविधा से लंबे documents या code files में position बदलना आसान हो जाता है
  • run के दौरान option toggle (-S, -R, -N आदि) और external command execution (!) के जरिए less से बाहर निकले बिना environment को तुरंत बदला जा सकता है

कई files को संभालना

  • less सिर्फ pipeline के अंत में इस्तेमाल होने वाला tool नहीं है, बल्कि कई files को सीधे arguments के रूप में खोल सकता है
    • उदाहरण: less file1 file2 file3
  • run के दौरान भी :e file.h कमांड से नई file जोड़ी जा सकती है
  • :n से अगली file, :p से पिछली file, :x या :rewind से पहली file पर जाना संभव है
  • :d कमांड से मौजूदा file को सूची से हटाया जा सकता है

navigation सुविधाएँ

  • 3141G की तरह number+G डालने पर किसी खास line number पर जाया जा सकता है
  • 75% की तरह number+% से file में प्रतिशत आधारित position पर jump किया जा सकता है
  • /pattern से forward search, ?pattern से backward search, n/N से अगले/पिछले result पर जाना संभव है
    • !pattern का मतलब मेल न खाने वाली line खोजना, * का मतलब कई files में search, @ का मतलब पहली file से search शुरू करना, @* का मतलब सभी files में पूरा search

filtering सुविधाएँ

  • &pattern से सिर्फ वही lines दिखती हैं जो उस pattern से match करती हैं, यह internal grep की तरह काम करता है
  • &!pattern से सिर्फ वे lines दिखती हैं जो pattern से match नहीं करतीं, जो log files देखने में उपयोगी है

bookmark और bracket matching

  • m + character से bookmark सेट, ' + character से उस position पर जाना
    • उदाहरण: mo से OPTIONS section, me से EXAMPLES section में bookmark रखने के बाद 'o, 'e से jump करना
  • अगर (, [, { जैसे brackets स्क्रीन की पहली line में हों, तो उसी bracket को input करने पर matching bracket पर jump किया जा सकता है
    • इसके उलट, अगर closing bracket आखिरी line में हो, तो opening bracket पर जाया जा सकता है
  • alt+ctrl+b आदि से custom bracket pairs भी सेट किए जा सकते हैं

option toggle और external command execution

  • run के दौरान - के बाद options डालकर settings तुरंत बदली जा सकती हैं
    • -S: line wrap toggle
    • -G: search highlight
    • -i/-I: case sensitivity setting
    • -R: ANSI colors दिखाना
    • -N/-n: line numbers दिखाना/छिपाना
  • ! कमांड से external command चलाना संभव है (!date, !bc आदि)

environment variables और अन्य सुविधाएँ

  • अक्सर इस्तेमाल होने वाले options को environment variable $LESS में save किया जा सकता है
    • उदाहरण: LESS="-RNe" → colors दिखाना, line numbers दिखाना, file के अंत में अपने आप exit
  • v कमांड से मौजूदा file को $VISUAL editor में खोलना
  • o या O कमांड से standard input से पढ़ी गई सामग्री को file में save किया जा सकता है
  • less ctags आधारित tag jump सुविधा को support करता है, हालांकि इसका उपयोग कम होता है

अभी कोई टिप्पणी नहीं है.

अभी कोई टिप्पणी नहीं है.