3

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?

5

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,

#!/bin/bash
sudo apt update
ls

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 '18 at 16:08
  • Please check again, link in my earlier comment is working correctly. – Hasan Dec 28 '18 at 16:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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