On Windows it's possible to create a *.ps1
(PowerShell) file where you can write one command per line or initialize variables etc. You then open it with VSCode and select the lines that you want to execute and press F8.
Is there something similar on Linux so that one doesn't have to type them in in the terminal everytime?
Additional clarification: I'm not looking for a way to write scripts and execute them. I know how to do this. I'm looking for a way to write some kind of a "favourite commands" file that I can open, select a line or two, press some keyboard shortcut and execute them as necessary.