I am new to elementary OS. I usually use windows. In windows we can create batch file which can make several command run at command prompt by single click. How to do this in elementary OS?

1 Answer 1


You can make shell scripts to achieve this. A shell script usually starts with #!/bin/bash. Let's say you want to execute sudo apt update and ls but you don't want to type it every time. So a shell script for that is,

sudo apt update

Save it with ".sh" extension and execute sudo chmod +x file_name.sh to give the file executable permission. Then you can execute the script by ./file_name.sh.
Take a look here, described well in this answer at askubuntu.

  • the link is not working may be
    – Tom
    Dec 28, 2018 at 16:08
  • Please check again, link in my earlier comment is working correctly.
    – Hasan
    Dec 28, 2018 at 16:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.