Creating and writing to files
Shell scripts allow you to automate terminal routines. This can be helpful for streamlining your workflow. Plus, it's fun.Shell script files end in .sh and are executed with the "sh" command from the terminal. So, you can create a shell script by typing "touch myScript.sh". You can write a basic script to the file by typing "nano myScript.sh" and typing up a script like:
echo "Hi. What's your favorite color? "
read COLOR
printf "Oh, so your favorite color is $COLOR. Mine is macaroni orange. "
Once you save (write out , ^O) your script and close nano to return to the terminal, you can execute it by typing "sh myScript.sh". Your terminal will then ask you what your favorite color, get your response, and tell you that its favorite color is macaroni orange.
Or you can simply skip the touching and nanoing and type into the terminal "echo "Hi. I'm a shell script." >> myScript.sh
Creating shortcuts to folders
You can also create shortcuts to folders very easily (so you don't have to type a long path every time you want to navigate there, or remember a convoluted path) by following the instructions here. You'll have to quit the Terminal app and restart it for these changes to take effect.Using the manual
When the "help" command doesn't bear fruit, use the "man" command instead. (Example: man ls) Press q to quit the manual once it's been "opened".
Or, just use this awesome site, Explain Shell. (example result linked.)