Skip to content
The Chat Archive
gemini-2.5-pro-preview-03-25· Google LMArena Human Preference 140K

ubuntu cmd to shut off pc in 1 hour

  1. User

    ubuntu cmd to shut off pc in 1 hour

  2. Assistant

    Okay, here's the command to shut down your Ubuntu PC in exactly 1 hour:

    sudo shutdown -P +60 "System will power off in 60 minutes. Save your work!"
    

    Explanation:

    1. sudo: This command requires administrative privileges, so sudo is necessary to execute it. You'll likely be prompted for your password.
    2. shutdown: This is the command itself used to shut down or reboot the system.
    3. -P: This option explicitly tells shutdown to Power off the machine after halting it. While often the default, it's good practice to include it for clarity. (You could also use -h to halt, which on most modern systems results in a power off anyway).
    4. +60: This specifies the time delay. The + means "minutes from now". So, +60 means 60 minutes from the time you press Enter.
    5. "System will power off...": This is an optional message that will be broadcast to all logged-in users (including yourself) warning them about the impending shutdown. It's highly recommended to include a message.

    To execute it:

    1. Open a Terminal (Ctrl+Alt+T is a common shortcut).
    2. Copy and paste the command above.
    3. Press Enter.
    4. Enter your user password when prompted.

    The system will then schedule the shutdown and display a confirmation message.

    How to Cancel the Scheduled Shutdown:

    If you change your mind before the hour is up, you can cancel the shutdown with:

    sudo shutdown -c
    

    This will cancel any pending shutdown command. A notification message about the cancellation will also be broadcast.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.