less
फ़ाइल और डायरेक्टरी
इस्तेमाल
less [file]फ़ाइल को पूरा पढ़े बिना एक-एक स्क्रीन दिखाता है; / से खोजें और q से निकलें, more की तरह अंत में अपने आप बंद नहीं होता।
आम विकल्प
| विकल्प | अर्थ |
|---|---|
| -N | Show line numbers |
| -S | Chop long lines instead of wrapping them |
| -i | Ignore case while searching unless the pattern has capitals |
| -R | Pass color escape codes through as colors |
| +F | Start in follow mode, like tail -f |
| -X | Leave the output on screen after quitting |
| /word | Search forward; n repeats it, q quits less |
उदाहरण
less +F /var/log/syslogFollows the log; Ctrl-C stops following and lets you scroll.
less -S wide.csvKeeps each record on one row so columns stay aligned.
git log | less -RPages colored output with the colors kept.
हटाना, मिटाना और ढूँढना। कुछ कमांड दोबारा नहीं पूछते, इसीलिए -i लगाने की आदत हाथ बचाती है।
कैसे पढ़ें
- बड़े कोष्ठक [ ] उस हिस्से को दिखाते हैं जिसे छोड़ा जा सकता है।
- तीन बिंदु … का मतलब है एक से ज़्यादा दिए जा सकते हैं।
- विकल्पों में बड़े-छोटे अक्षर मायने रखते हैं — कुछ कमांड में -r और -R अलग काम करते हैं।
आम सवाल
Q. less क्या करता है?
फ़ाइल को पूरा पढ़े बिना एक-एक स्क्रीन दिखाता है; / से खोजें और q से निकलें, more की तरह अंत में अपने आप बंद नहीं होता।
Q. इसे कैसे लिखें?
less [file] — बड़े कोष्ठक वह हिस्सा दिखाते हैं जो छोड़ा जा सकता है।
Q. कितने विकल्प जानने लायक़ हैं?
यहाँ 7 दिए हैं; पूरी सूची man less में है। यह कमांड फ़ाइल और डायरेक्टरी में आती है।
मिलती-जुलती कमांड
man पेज: man less