Results 1 to 6 of 6

Thread: How would I make a command that inputs something to terminal?

  1. #1
    Join Date
    Jul 2012
    Beans
    19

    Question How would I make a command that inputs something to terminal?

    Hello, I have Ubuntu on a flash drive. The one problem I have is when I log off of the default account (Ubuntu) and onto my personal it wont shut down or restart when I tell it to. I have read that I can issue "sudo shutdown -P now" and it will shut it down. However I would like to be able to click something on my desktop or something of that nature to shut the machine off. I would do the same with with "sudo reboot"

    Help is appreciated,
    Thanks

  2. #2
    dino99's Avatar
    dino99 is offline Ubuntu addict and loving it
    Join Date
    Jun 2006
    Location
    Nux Jam
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: How would I make a command that inputs something to terminal?

    enter that command BEFORE logging out

  3. #3
    Join Date
    Jul 2012
    Beans
    19

    Re: How would I make a command that inputs something to terminal?

    Quote Originally Posted by dino99 View Post
    enter that command BEFORE logging out
    Is there a way I can make the command click able?

  4. #4
    Join Date
    May 2012
    Location
    UK
    Beans
    613

    Re: How would I make a command that inputs something to terminal?


  5. #5
    Join Date
    Apr 2012
    Beans
    5,316

    Re: How would I make a command that inputs something to terminal?

    Hi, afaik a standard (non-sudo) user *should* be able to shutdown / reboot via the taskbar "power button" by default - what happens when you try?

    http://askubuntu.com/questions/15866...-panel-no-sudo

    The only exception should be if another user is also logged in - in which case root is required (i.e. only root is allowed to kill *another* user's session).

  6. #6
    Join Date
    Aug 2007
    Location
    Sweden
    Beans
    197
    Distro
    Xubuntu 10.04 Lucid Lynx

    Re: How would I make a command that inputs something to terminal?

    This is 2 different problems

    Quote Originally Posted by Hydera5 View Post
    Hello, I have Ubuntu on a flash drive. The one problem I have is when I log off of the default account (Ubuntu) and onto my personal it wont shut down or restart when I tell it to.
    (I don't know why normal shutdown does not work for you. Maybe permissions are set up differently on a live-system than on a normal system.)

    Quote Originally Posted by Hydera5 View Post
    I have read that I can issue "sudo shutdown -P now" and it will shut it down. However I would like to be able to click something on my desktop or something of that nature to shut the machine off. I would do the same with with "sudo reboot"
    You can place a Launcher in the panel or on the desktop. In the command field of the launcher, enter the command
    Code:
    gksu shutdown -P now
    When you press that button it will ask for a password and then (hopefully) shut down.

    (Explanation: gksu is required instead of sudo, because sudo assumes there is a terminal where the password is entered.)

    (Techno mumbo jumbo name dropping: The title is misleading because nothing needs to be input to a terminal. The launcher invokes a shell to execute the command, or issues an exec system call directly.)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •