ls
फ़ाइल और डायरेक्टरी
इस्तेमाल
ls -la [path]दिखाता है कि किसी डायरेक्टरी में क्या है; डॉट से शुरू होने वाले नाम -a लगाने तक छिपे रहते हैं।
आम विकल्प
| विकल्प | अर्थ |
|---|---|
| -l | One line per entry with mode, owner, size and time |
| -a | Include names that begin with a dot |
| -h | Sizes as 4.0K instead of 4096, together with -l |
| -t | Sort by modification time, newest first |
| -r | Reverse whatever order is in effect |
| -S | Sort by size, largest first |
| -R | Walk into subdirectories |
| -d | Show the directory itself instead of its contents |
उदाहरण
ls -lhLong listing with readable sizes.
ls -latNewest first, hidden files included.
ls -d */Only the directories in this folder.
हटाना, मिटाना और ढूँढना। कुछ कमांड दोबारा नहीं पूछते, इसीलिए -i लगाने की आदत हाथ बचाती है।
कैसे पढ़ें
- बड़े कोष्ठक [ ] उस हिस्से को दिखाते हैं जिसे छोड़ा जा सकता है।
- तीन बिंदु … का मतलब है एक से ज़्यादा दिए जा सकते हैं।
- विकल्पों में बड़े-छोटे अक्षर मायने रखते हैं — कुछ कमांड में -r और -R अलग काम करते हैं।
आम सवाल
Q. ls क्या करता है?
दिखाता है कि किसी डायरेक्टरी में क्या है; डॉट से शुरू होने वाले नाम -a लगाने तक छिपे रहते हैं।
Q. इसे कैसे लिखें?
ls -la [path] — बड़े कोष्ठक वह हिस्सा दिखाते हैं जो छोड़ा जा सकता है।
Q. कितने विकल्प जानने लायक़ हैं?
यहाँ 8 दिए हैं; पूरी सूची man ls में है। यह कमांड फ़ाइल और डायरेक्टरी में आती है।
मिलती-जुलती कमांड
man पेज: man ls