realpath

फ़ाइल और डायरेक्टरी

इस्तेमाल

realpath [path]

किसी भी रास्ते को symlink और बिंदु सुलझाकर एक absolute रास्ता बना देता है; macOS पर BSD संस्करण होता है, इसलिए --relative-to जैसे GNU विकल्प नहीं मिलते।

आम विकल्प

विकल्पअर्थ
-qBSD and macOS: stay quiet when a path cannot be resolved
-eGNU: fail unless every component exists
-mGNU: never fail, even if nothing exists
-sGNU: do not expand symlinks
--relative-toGNU: print the answer relative to a directory

उदाहरण

realpath ../src/./index.ts

Prints one absolute path with dots resolved.

realpath --relative-to=/var /var/log/nginx

Prints log/nginx (GNU only).

हटाना, मिटाना और ढूँढना। कुछ कमांड दोबारा नहीं पूछते, इसीलिए -i लगाने की आदत हाथ बचाती है।

कैसे पढ़ें

  • बड़े कोष्ठक [ ] उस हिस्से को दिखाते हैं जिसे छोड़ा जा सकता है।
  • तीन बिंदु … का मतलब है एक से ज़्यादा दिए जा सकते हैं।
  • विकल्पों में बड़े-छोटे अक्षर मायने रखते हैं — कुछ कमांड में -r और -R अलग काम करते हैं।

आम सवाल

Q. realpath क्या करता है?

किसी भी रास्ते को symlink और बिंदु सुलझाकर एक absolute रास्ता बना देता है; macOS पर BSD संस्करण होता है, इसलिए --relative-to जैसे GNU विकल्प नहीं मिलते।

Q. इसे कैसे लिखें?

realpath [path] — बड़े कोष्ठक वह हिस्सा दिखाते हैं जो छोड़ा जा सकता है।

Q. कितने विकल्प जानने लायक़ हैं?

यहाँ 5 दिए हैं; पूरी सूची man realpath में है। यह कमांड फ़ाइल और डायरेक्टरी में आती है।

मिलती-जुलती कमांड

man पेज: man realpath