How to run .sh files in Linux?

Even though I have posted this in fedora category, it works for all linux distros. To execute/run any .sh files.

run the followig comands:

  • first give execute permission to script file : chmod +x /path/to/scriptfile.sh
  • and to run the script: /path/to/scriptfile.sh
  • if scriptfile.sh is in current directory then you do it with: ./scriptfile.sh

as ./ refers to current directory

after doing this it must be running, if still not then

  • browse to the script file with a file manager
  • right-click to properties
  • open permissions
  • make sure: Allow executing file as the program is checked on.

About the Author

lakshman basnet portrait photo

Lakshman enjoys living with technology. Digital marketer by profession, he loves writing and sharing his experience about technology, life and travel in this blog.