Question:

How do i run programs/scripts in linux command line?

by  |  earlier

0 LIKES UnLike

ok i have this script in my home directory, but permissions require it to be run as root. so i cd to my home directory and type in sudo scriptname but it says that its not a proper command or something

do i have to put a ./ or .\ or something (dot \)

 Tags:

   Report

1 ANSWERS


  1. Make sure that the script is executable with

    chmod u+x scriptname

    Then to execute:

    /path/to/script/scriptname

    Or, if you're already in that directory:

    ./scriptname

    If you didn't start your script with the line

    #!/bin/bash

    then you will need to type:

    /bin/bash ./scriptname

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.