file
फ़ाइल और डायरेक्टरी
इस्तेमाल
file [path]फ़ाइल का प्रकार नाम से नहीं, सामग्री से पहचानता है; extension को अनदेखा करता है, इसीलिए .jpg जो असल में PDF है, यहाँ पकड़ा जाता है।
आम विकल्प
| विकल्प | अर्थ |
|---|---|
| -b | Print only the description, without the file name |
| --mime-type | Print the MIME type; the short form is -i on GNU, -I on macOS |
| -L | Follow symlinks |
| -z | Look inside compressed files |
| -s | Read block and character devices too |
| -i | On BSD and macOS this means do not classify contents, not MIME |
उदाहरण
file screenshotSays PNG image data even with no extension.
file -b --mime-type report.pdfPrints application/pdf and nothing else.
file *Types every entry in this directory.
हटाना, मिटाना और ढूँढना। कुछ कमांड दोबारा नहीं पूछते, इसीलिए -i लगाने की आदत हाथ बचाती है।
कैसे पढ़ें
- बड़े कोष्ठक [ ] उस हिस्से को दिखाते हैं जिसे छोड़ा जा सकता है।
- तीन बिंदु … का मतलब है एक से ज़्यादा दिए जा सकते हैं।
- विकल्पों में बड़े-छोटे अक्षर मायने रखते हैं — कुछ कमांड में -r और -R अलग काम करते हैं।
आम सवाल
Q. file क्या करता है?
फ़ाइल का प्रकार नाम से नहीं, सामग्री से पहचानता है; extension को अनदेखा करता है, इसीलिए .jpg जो असल में PDF है, यहाँ पकड़ा जाता है।
Q. इसे कैसे लिखें?
file [path] — बड़े कोष्ठक वह हिस्सा दिखाते हैं जो छोड़ा जा सकता है।
Q. कितने विकल्प जानने लायक़ हैं?
यहाँ 6 दिए हैं; पूरी सूची man file में है। यह कमांड फ़ाइल और डायरेक्टरी में आती है।
मिलती-जुलती कमांड
man पेज: man file