Linux shutdown कमांड क्या है?

shutdown कमांड एक built-in Linux utility है जिसका उपयोग सिस्टम को नियंत्रित तरीके से power off, halt, या reboot करने के लिए किया जाता है। Plug खींचने के विपरीत, यह gracefully services को बंद करता है, pending writes को disk पर flush करता है, और machine बंद होने से पहले logged-in users को सूचित करता है। यह data loss, file system corruption, और interrupted background jobs को रोकता है।

कमांड action को एक specific time के लिए schedule करता है (तुरंत, कुछ मिनटों के बाद, या एक exact clock time पर) और optionally सभी logged-in users को एक wall message broadcast करता है ताकि वे अपना काम save कर सकें। क्योंकि यह system state को बदलता है, इसे normally root privileges की आवश्यकता होती है और अधिकांश distributions पर sudo के साथ invoke किया जाता है।

Tool description

यह tool आपके द्वारा चुने गए options के आधार पर Linux systems के लिए ready-to-paste shutdown commands generate करता है। Action चुनें (power off, halt, reboot, या cancel), चुनें कि यह कब चलना चाहिए, optionally एक warning message शामिल करें, और सही command तुरंत दिखाई देता है।

Examples

Scenario Generated command
तुरंत power off करें sudo shutdown -P now
5 मिनट में reboot करें sudo shutdown -r +5
23:00 पर message के साथ power off करें sudo shutdown -P 23:00 "Server maintenance tonight"
केवल warning भेजें, shutdown नहीं sudo shutdown -P -k +10 "Reboot in 10 minutes"
Pending shutdown को cancel करें sudo shutdown -c

Features

  • Power off, halt, reboot, और cancel actions को support करता है
  • तीन time modes: immediate, minutes में delay, या exact clock time (HH:MM)
  • Optional wall message broadcast logged-in users को
  • sudo, warning-only mode (-k), और wall broadcast को disable करने के लिए toggle (--no-wall)
  • Live command preview जो options बदलने पर update होता है

Use cases

  • System administrators जो production servers पर maintenance reboots schedule करते हैं
  • Developers जो cron jobs या automation scripts लिखते हैं जिन्हें सही shutdown syntax की आवश्यकता होती है
  • Users जो कभी-कभी Linux machines को manage करते हैं और flags को याद रखने से बचना चाहते हैं

Options explained

  • Action — Operation को select करता है: -P (power off), -H (power off के बिना halt), -r (reboot), या -c (previously scheduled shutdown को cancel करें)।
  • Time modenow तुरंत चलता है, minutes +N मिनटों से delay करता है, और at time एक specific HH:MM clock time के लिए schedule करता है।
  • Wall message — Text जो सभी logged-in terminals को upcoming action की warning देने के लिए broadcast किया जाता है।
  • Use sudosudo को prepend करता है क्योंकि shutdown को अधिकांश systems पर root privileges की आवश्यकता होती है।
  • Warning only (-k) — Wall message भेजता है और कुछ भी schedule नहीं करता; notifications को test करने के लिए उपयोगी।
  • No wall (--no-wall) — अन्य users को broadcast message को suppress करता है।

Tips

  • Immediate shutdown के लिए +0 या now का उपयोग करें; दोनों को shutdown binary द्वारा स्वीकार किया जाता है।
  • यदि एक scheduled shutdown पहले से pending है, तो एक नया schedule करने से पहले cancel action (shutdown -c) चलाएं।
  • Systemd-based distributions पर, shutdown एक symlink है systemctl के लिए, इसलिए यही कमांड Ubuntu, Debian, Fedora, Arch, और अधिकांश modern Linux systems पर काम करता है।