Where can I learn, basically, how to set them up?
For setting up a script which executes commands, just create a file (e.g.
MyCmds.sh) with your editor and write some commands, which you want to execute. E.g.:
# This is a quote, the next line will output "Hello World"
echo "Hello World"
Now you need to make this file executable by setting the
x flag (use your terminal for this):
$ chmod +x MyCmds.sh
Now you can run it like this in your terminal (do not forget the leading
You should see
Also, how can I make one run at startup?
To run this script at startup, you have to put the commands, or your script with the absolut path (e.g.
/path/to/my/script/MyCmds.sh), into the textfile
/etc/rc.local (There is sometimes an
exit 0 at the end, your commands have be above that line).
PS Are the shell and the terminal/command line the same?
Yes (and maybe No). I assume that you mean the normal command line where you type in your commands and the with shell the sripts, am I right?
It always depends on your setup. If you run a script with
#!/bin/bash (the first two signes are called
shebang) in the
first line, every following line will be passed to the shell-program located at
/bin/bash. What you see as your command line is maybe
... (They differ by their features). You can check this by looking at the file
/etc/passwd. After your linux username there should stand the program for your command line.