base64
टेक्स्ट प्रोसेसिंग
इस्तेमाल
base64 [file]bytes को ASCII पाठ में और वापस बदलता है ताकि binary केवल-पाठ रास्तों से जा सके; यह encoding है, encryption नहीं, और decode का विकल्प GNU में -d पर पुराने macOS में -D है।
आम विकल्प
| विकल्प | अर्थ |
|---|---|
| -d | Decode. GNU and recent macOS take -d; older macOS needs -D |
| -w | GNU: wrap at N columns, and -w0 keeps it on one line |
| -i | GNU: ignore junk while decoding. On macOS -i names the input file |
| -o | BSD and macOS: write to this file |
| -b | BSD and macOS: wrap the encoded output at N characters |
उदाहरण
base64 -w0 cert.pemOne long line, no wrapping (GNU).
echo aGVsbG8= | base64 -dDecodes back to hello.
base64 -i photo.png -o photo.txtEncoding into a file on macOS.
ये पाइप से जोड़कर चलाने के लिए बने हैं। एक ही कमांड से सब करवाने के बजाय तीन जोड़ना छोटा पड़ता है।
कैसे पढ़ें
- बड़े कोष्ठक [ ] उस हिस्से को दिखाते हैं जिसे छोड़ा जा सकता है।
- तीन बिंदु … का मतलब है एक से ज़्यादा दिए जा सकते हैं।
- विकल्पों में बड़े-छोटे अक्षर मायने रखते हैं — कुछ कमांड में -r और -R अलग काम करते हैं।
आम सवाल
Q. base64 क्या करता है?
bytes को ASCII पाठ में और वापस बदलता है ताकि binary केवल-पाठ रास्तों से जा सके; यह encoding है, encryption नहीं, और decode का विकल्प GNU में -d पर पुराने macOS में -D है।
Q. इसे कैसे लिखें?
base64 [file] — बड़े कोष्ठक वह हिस्सा दिखाते हैं जो छोड़ा जा सकता है।
Q. कितने विकल्प जानने लायक़ हैं?
यहाँ 5 दिए हैं; पूरी सूची man base64 में है। यह कमांड टेक्स्ट प्रोसेसिंग में आती है।
मिलती-जुलती कमांड
man पेज: man base64