Results 1 to 4 of 4

Thread: Command line, commands in a file and double click?

  1. #1
    Join Date
    Jun 2010
    Location
    UA
    Beans
    29
    Distro
    Ubuntu 10.04 Lucid Lynx

    Arrow Command line, commands in a file and double click?

    Hi!
    A question:
    I want to make a simple file that executes some lines when I click it, without having to type them in the command line every time.
    How can I do that?
    Also, how can I make some lines to run automatically at startup?
    And a last question:
    To mount my windows files, I use
    sudo mount /dev/sda1 /mnt/win
    And it works. However, on the net everywhere I see the line
    mount -t ntfs /dev/sda2 /mnt/windows -o "umask=022"
    Does this matter? What is the difference?
    By the way, the last couple of days I keep getting
    sudo: unable to solve host ubuntu
    every time I use sudo, but it still works. Should I worry about it?
    Thank you very much if someone can help me with that.

  2. #2
    Join Date
    Nov 2010
    Beans
    Hidden!

    Re: Command line, commands in a file and double click?

    To make some commands execute when you click on a file you could put those commands in a text file and then save the file with a .sh extension to indicate that it is a script. Change the permissions of the file to allow execution by the required users. And then you could just click on it to run it.

    To add some commands to startup you could do the same thing as above and then add that file to startup. To add it to startup you would have to look for a Manage startup applications option in the control center.

    The windows partition mount command that you use in the terminal is the manual way of doing it and there is one other way of adding an entry in fstab. In this the way it will automatically be mounted each time and you wont need to issue the command at the terminal.

    The second command in the first post does the same thing as the first one but it is with some more explicit options that are specified in it. The -t option specifies that the filesystem type of the partition that is being mounted is ntfs.
    Last edited by ppv; December 28th, 2010 at 06:36 PM.

  3. #3
    Join Date
    Jun 2010
    Location
    UA
    Beans
    29
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Command line, commands in a file and double click?

    Thank you so much!

  4. #4
    Join Date
    Jul 2005
    Location
    I think I'm here! Maybe?
    Beans
    Hidden!
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: Command line, commands in a file and double click?

    By the way, the last couple of days I keep getting
    sudo: unable to solve host ubuntu
    every time I use sudo, but it still works. Should I worry about it?
    Thank you very much if someone can help me with that.
    Have a look at your /etc/hosts and /etc/hostname files and make sure they both have the same entry for your machine name. That should be the same as the name that shows in your terminal prompt, ie, username@hostname, and needs to be the same in both of those files. If one of them is incorrect, edit it with
    Code:
    gksudo gedit /etc/hostname
    .

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
  •