The Mac Terminal Reference and Scripting Primer
By Jay Docherty
4.5/5
()
About this ebook
Now updated to cover El Capitan's new Terminal features, including Marks and Restorable Terminal Sessions.
Take control of your Mac! 61 of the most useful Mac Terminal commands collected for the first time in this handy guide and organized into categories:
- Terminal basics
- System commands
- Power Management & Energy Saving
- OS X Look and Feel
- Networking
- Troubleshooting
- Users and permissions
- Text Manipulation
- iTunes
- Other useful commands
- How to use temporary files instead of the clipboard
To put these tools into context we've also included brief primers on a range of Mac OS X functionality, including:
- 'Getting started with the Terminal' including a quick exercise
- bash scripting
- AppleScript, Automator, and Folder Actions
- Quick guide to Web Automation
- How to use the Mac OS X /etc/hosts file to:
- Block access to websites
- Easily run multiple websites on a personal web server (e.g.: MAMP) - great for web designers
This is not an exhaustive reference: We've focused on only the most useful stuff to give you the tools you need.
Jay Docherty
I run a small web development company. I’ve been writing PHP since 2000, and HTML since 1996. I have a passion for the Mac OS and technical writing and in addition to golearnphp.com run the Mac-focussed blog leftcolumn.net.
Related to The Mac Terminal Reference and Scripting Primer
Related ebooks
Mac Unlocked: Everything You Need to Know to Get Cracking in macOS Big Sur Rating: 0 out of 5 stars0 ratingsmacOS Black Book: Mastering Shortcut Keys Rating: 0 out of 5 stars0 ratingsGoing Text: Mastering the Command Line Rating: 4 out of 5 stars4/5The Windows Command Line Beginner's Guide: Second Edition Rating: 4 out of 5 stars4/5Bash Command Line Pro Tips Rating: 5 out of 5 stars5/5Windows Command Prompt A-N Rating: 5 out of 5 stars5/5Simply Linux: Basics Rating: 5 out of 5 stars5/5Getting Started With Ubuntu OS: A Ridiculously Simple Guide to the Linux Open Source Operating System Rating: 0 out of 5 stars0 ratingsWindows Command Prompt Rating: 0 out of 5 stars0 ratingsBasics with Windows Powershell Rating: 0 out of 5 stars0 ratings20 Windows Tools Every SysAdmin Should Know Rating: 5 out of 5 stars5/5Linux Command-Line Tips & Tricks Rating: 0 out of 5 stars0 ratingsLet's Use BASH on Windows 10! Rating: 0 out of 5 stars0 ratingsLearning Linux Shell Scripting Rating: 4 out of 5 stars4/5Working with Linux – Quick Hacks for the Command Line Rating: 5 out of 5 stars5/5The Complete Powershell Training for Beginners Rating: 0 out of 5 stars0 ratingsLinux Commands By Example Rating: 5 out of 5 stars5/5An Ultimate Guide to Kali Linux for Beginners Rating: 3 out of 5 stars3/542 Astoundingly Useful Scripts and Automations for the Macintosh Rating: 0 out of 5 stars0 ratingsArch Linux: Fast and Light! Rating: 3 out of 5 stars3/5Linux: Learn in 24 Hours Rating: 5 out of 5 stars5/5macOS High Sierra: Up To Speed Rating: 0 out of 5 stars0 ratingsLinux: A complete guide to Linux command line for beginners, and how to get started with the Linux operating system! Rating: 0 out of 5 stars0 ratingsMacintosh OS X Interview Questions, Answers, and Explanations: Macintosh OS X Certification Review Rating: 0 out of 5 stars0 ratingsNode.js: Tools & Skills Rating: 0 out of 5 stars0 ratingsThe Linux Mint Beginner's Guide Rating: 5 out of 5 stars5/5Windows Batch File Programming Rating: 2 out of 5 stars2/550 Recipes for Programming Node.js Rating: 3 out of 5 stars3/5
Operating Systems For You
Windows 11 All-in-One For Dummies Rating: 5 out of 5 stars5/5Learn Windows PowerShell in a Month of Lunches Rating: 0 out of 5 stars0 ratingsLinux: Learn in 24 Hours Rating: 5 out of 5 stars5/5Hacking : The Ultimate Comprehensive Step-By-Step Guide to the Basics of Ethical Hacking Rating: 5 out of 5 stars5/5macOS Big Sur For Dummies Rating: 0 out of 5 stars0 ratingsMastering Windows PowerShell Scripting Rating: 4 out of 5 stars4/5Hacking for Beginners: Mastery Guide to Learn and Practice the Basics of Computer and Cyber Security Rating: 0 out of 5 stars0 ratingsExcel : The Ultimate Comprehensive Step-By-Step Guide to the Basics of Excel Programming: 1 Rating: 5 out of 5 stars5/5The Linux Command Line Beginner's Guide Rating: 4 out of 5 stars4/5COBOL Basic Training Using VSAM, IMS and DB2 Rating: 5 out of 5 stars5/5OneNote: The Ultimate Guide on How to Use Microsoft OneNote for Getting Things Done Rating: 1 out of 5 stars1/5Bash Command Line Pro Tips Rating: 5 out of 5 stars5/5Getting Started With MacBook Air (2020 Model): A Guide For New MacOS Users Rating: 0 out of 5 stars0 ratingsiPhone 12, iPhone Pro, and iPhone Pro Max For Senirs: A Ridiculously Simple Guide to the Next Generation of iPhone and iOS 14 Rating: 0 out of 5 stars0 ratingsPowerShell: A Comprehensive Guide to Windows PowerShell Rating: 4 out of 5 stars4/5macOS High Sierra For Dummies Rating: 3 out of 5 stars3/5Linux Command Line and Shell Scripting Bible Rating: 3 out of 5 stars3/5Linux Command-Line Tips & Tricks Rating: 0 out of 5 stars0 ratingsNetworking for System Administrators: IT Mastery, #5 Rating: 5 out of 5 stars5/5iPhone Unlocked Rating: 0 out of 5 stars0 ratingsLinux for Beginners: Linux Command Line, Linux Programming and Linux Operating System Rating: 4 out of 5 stars4/5Hacking Essentials - The Beginner's Guide To Ethical Hacking And Penetration Testing Rating: 3 out of 5 stars3/5UNIX For Dummies Rating: 3 out of 5 stars3/5Raspberry Pi for Secret Agents - Second Edition Rating: 3 out of 5 stars3/5Make Your PC Stable and Fast: What Microsoft Forgot to Tell You Rating: 4 out of 5 stars4/5Mastering Linux Shell Scripting Rating: 4 out of 5 stars4/5Exploring Windows 11: The Illustrated, Practical Guide to Using Microsoft Windows Rating: 0 out of 5 stars0 ratings
Reviews for The Mac Terminal Reference and Scripting Primer
3 ratings1 review
- Rating: 4 out of 5 stars4/5Good book with great explantations for commands. Great book for beginners with MAC Terminal users.
Book preview
The Mac Terminal Reference and Scripting Primer - Jay Docherty
2016 Introduction
It’s 2016 and time this book was refreshed. El Capitan is out now, with some cool new features in the Terminal. I also wanted to cover node.js and ruby, both of which make available much-needed functionality to the Terminal. Finally, and most importantly, I’ve beefed up and improved the Terminal Commands chapter, which is the heart of this book. Enjoy.
Original Introduction
A very long time ago I wrote a blog post called 40 Useful Mac OS X Shell Scripts and Terminal Commands.
It’s been pretty popular ever since, with many thousands of people using it every month. Over the years I’ve been asked for a PDF version but somehow I never quite got around to it. But now I’ve revised and edited it from the original post and added a bunch of new commands. I’ve also included primers on bash scripting, AppleScript and Automator; and tips on integrating these different tools. The book also features a guide to the Mac /etc/hosts file, revised and expanded from two of the most popular posts on the site.
I’ve put together a collection of resources for owners of this book at www.leftcolumn.net/terminal-resources/; please go there to leave comments and ask questions.
I hope you find this reference useful. Cheers!
Jay
1. How to use Terminal.app
Before we get on to the reference we need to briefly cover the basics. Terminal.app is located in /Application/Utilities. Usually you run it by double-clicking, but it is also possible to use it to launch associated files. Most commonly this means opening a .sh file (a ‘shell script’) from the Finder. Shell scripts are a way of chaining together small tools so that they