@finnm
Linux Oct 13, 2026

running a .sh script in the Ubuntu terminal

Downloaded an installer that's just a .sh file. Typing its name says command not found. Do I need to change permissions first?
2

Leave A Reply

Log in to post an answer.

2 Answers

mia_tech Nov 12, 2026
finnm
Permission denied even after chmod? Check where the script is. On a Windows/NTFS drive, or somewhere mounted noexec, chmod does nothing. Copy it into your home folder and run it from there.
gus_helpdesk Oct 19, 2026
finnm
chmod +x script.sh then ./script.sh. or skip the chmod and run bash script.sh. the thing that catches people: if the script was written or saved on Windows you get a weird bad interpreter error with ^M in it. that's Windows line endings. dos2unix script.sh fixes it, or sed -i 's/\r$//' script.sh if you don't have dos2unix installed.