rm

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

इस्तेमाल

rm -rf [path]

फ़ाइलें हमेशा के लिए मिटा देता है — कोई कूड़ेदान नहीं होता, और rm -rf में एक अतिरिक्त space ग़लत चीज़ उड़ा देता है।

आम विकल्प

विकल्पअर्थ
-rDescend into directories and delete what is inside
-fNever prompt, and say nothing about files that are missing
-iAsk before every single removal
-dRemove an empty directory without -r
-vPrint each name as it goes
-IGNU: ask once before removing more than three files
-PmacOS: overwrite the file before unlinking it

उदाहरण

rm -rf build

Deletes the build directory and everything under it.

rm -i *.log

Asks about each log file first.

rm -- -weird

Deletes a file whose name starts with a dash.

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

कैसे पढ़ें

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

आम सवाल

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

फ़ाइलें हमेशा के लिए मिटा देता है — कोई कूड़ेदान नहीं होता, और rm -rf में एक अतिरिक्त space ग़लत चीज़ उड़ा देता है।

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

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

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

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

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

man पेज: man rm