1. Create a text file with the commands you want to execute.
2. Make the file executable. (chmod 755 <filename>)
3. Run it. (./<filename>)
That's just the beginning. However, you *will* need to spell things correctly. If you don't, OS X at the command line (BSD Unix) will do EXACTLY what you tell it to do, whether you intended it or not. Unix is extremely powerful and terribly unforgiving.
Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.