Find the answer to your Linux question:
Results 1 to 5 of 5
Hi, I would like linux to execute a command line everytime it starts: The command line: vncserver :1 -geometry 1280x800 -depth 16 -pixelformat rgb565 That would avoid having to execute ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2013
    Posts
    3

    Command line on start


    Hi,

    I would like linux to execute a command line everytime it starts:

    The command line: vncserver :1 -geometry 1280x800 -depth 16 -pixelformat rgb565


    That would avoid having to execute it through Putty everytimes I reboot .


    THank you

  2. #2
    Linux Newbie
    Join Date
    Jan 2013
    Location
    Argentina
    Posts
    122
    I believe you need to place it on rc.local file, but I'm not sure how exactly or if it would work.

  3. #3
    Linux Newbie
    Join Date
    Aug 2010
    Posts
    234
    you will want to create a script file and name it use the .sh extention.
    nano <yourfile>.sh

    start the file with:

    #!/bin/bash

    <your code>

    Then save and exit your code

    Then change permissions to the file

    # chmod 755 <file>

    edit /etc/rc.local and add the file path of your script to it. save and exit.
    .

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined! unabombe's Avatar
    Join Date
    Jan 2013
    Posts
    2
    Distro, etc..?

  6. #5
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,752
    I usually put stuff like this in /etc/rc.local. I start up a number of vpn's (virtual private networks) when the system boots this way. rc.local is a script that runs after all the other system startup cruft is finished.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

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