I wonder if I can execute something in terminal, like .bat on Windows. Like, writing the script on the terminal, saving it somewhere, for example on desktop, and opening it, running automatically. I'm asking this beacuse Steam is bugged on Ubuntu 16.04, and the only way i can run this code LD_PRELOAD='/usr/$LIB/libstdc++.so.6' DISPLAY=:0 steam
through terminal.
Yes, you can run a command line manually and you can create
bash
shellscript files and run them likebat
files in MSDOS and acmd
window in Windows. The commands in linux are very powerful.So start a terminal window from dash or with the hotkey combination ctrl + alt + t
and simply type the commands or copy and paste them into the terminal window. You can create a batch file with a text editor, gedit (graphical) or nano (text) and give it a name.
The name needs no extension (like
bat
), but you should give it execute permissions to run it easily (text after # is a comment, not used by the shell).If you want to be sure, that
bash
runs it (and no other shell), you can write the following into the first line of the shellscript fileNow you can run it (in the current directory . (dot)) with
If you create the directory bin in your home directory
and move your shellscript into that directory, it will be in
PATH
and can be run from any directory withPATH
works in the same way as in Windows.