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 ratingsBash Command Line Pro Tips Rating: 5 out of 5 stars5/5Windows Command Prompt A-N Rating: 5 out of 5 stars5/5Linux Command-Line Tips & Tricks Rating: 0 out of 5 stars0 ratingsGoing Text: Mastering the Command Line Rating: 4 out of 5 stars4/520 Windows Tools Every SysAdmin Should Know Rating: 5 out of 5 stars5/542 Astoundingly Useful Scripts and Automations for the Macintosh Rating: 0 out of 5 stars0 ratingsBash for Fun: Bash Programming: Principles and Examples Rating: 0 out of 5 stars0 ratingsLet's Use BASH on Windows 10! Rating: 0 out of 5 stars0 ratingsWindows Command Prompt Rating: 0 out of 5 stars0 ratingsSimply Linux: Basics Rating: 5 out of 5 stars5/5The Windows Command Line Beginner's Guide: Second Edition Rating: 4 out of 5 stars4/5Arch Linux: Fast and Light! Rating: 3 out of 5 stars3/5Windows Batch File Programming Rating: 2 out of 5 stars2/5Linux for Beginners: Linux Command Line, Linux Programming and Linux Operating System Rating: 4 out of 5 stars4/5Working with Linux – Quick Hacks for the Command Line Rating: 5 out of 5 stars5/5Ubuntu Linux Toolbox: 1000+ Commands for Power Users Rating: 3 out of 5 stars3/5Basics with Windows Powershell Rating: 0 out of 5 stars0 ratingsLinux Commands By Example Rating: 5 out of 5 stars5/5Linux: 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 ratingsThe Complete Powershell Training for Beginners Rating: 0 out of 5 stars0 ratingsAn Ultimate Guide to Kali Linux for Beginners Rating: 3 out of 5 stars3/5LINUX FOR NOVICES: A Beginner's Guide to Mastering the Linux Operating System (2023) Rating: 0 out of 5 stars0 ratingsLinux: Learn in 24 Hours Rating: 5 out of 5 stars5/5Easy Linux For Beginners Rating: 2 out of 5 stars2/5A concise guide to PHP MySQL and Apache Rating: 4 out of 5 stars4/5
Operating Systems For You
Excel : The Ultimate Comprehensive Step-By-Step Guide to the Basics of Excel Programming: 1 Rating: 5 out of 5 stars5/5iPhone For Dummies Rating: 0 out of 5 stars0 ratingsThe Windows Command Line Beginner's Guide: Second Edition Rating: 4 out of 5 stars4/5Linux: Learn in 24 Hours Rating: 5 out of 5 stars5/5Linux Command-Line Tips & Tricks Rating: 0 out of 5 stars0 ratingsWindows 11 For Dummies Rating: 0 out of 5 stars0 ratingsMacBook Pro User Manual: 2022 MacBook Pro User Guide for beginners and seniors to Master Macbook Pro like a Pro Rating: 0 out of 5 stars0 ratingsThe Linux Command Line Beginner's Guide Rating: 4 out of 5 stars4/5Make Your PC Stable and Fast: What Microsoft Forgot to Tell You Rating: 4 out of 5 stars4/5Ubuntu Linux Bible Rating: 0 out of 5 stars0 ratingsmacOS Sonoma For Dummies Rating: 0 out of 5 stars0 ratingsOneNote: The Ultimate Guide on How to Use Microsoft OneNote for Getting Things Done Rating: 1 out of 5 stars1/5iPhone Unlocked Rating: 0 out of 5 stars0 ratingsApple Card and Apple Pay: A Ridiculously Simple Guide to Mobile Payments Rating: 0 out of 5 stars0 ratingsTor Darknet Bundle: Master the Art of Invisibility Rating: 0 out of 5 stars0 ratingsWindows 11 All-in-One For Dummies 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/5The iPadOS 17: The Complete User Manual to Quick Set Up and Mastering the iPadOS 17 with New Features, Pictures, Tips, and Tricks Rating: 0 out of 5 stars0 ratingsCompTIA Linux+ Study Guide: Exam XK0-004 Rating: 0 out of 5 stars0 ratingsLearn Windows PowerShell in a Month of Lunches Rating: 0 out of 5 stars0 ratingsNetworking for System Administrators: IT Mastery, #5 Rating: 5 out of 5 stars5/5Raspberry Pi Cookbook for Python Programmers Rating: 0 out of 5 stars0 ratingsLinux Bible Rating: 0 out of 5 stars0 ratingsAndroid Security Cookbook Rating: 0 out of 5 stars0 ratingsM2 Mac Book Air User Guide: Features, Tips, and Tricks With Pictures Rating: 0 out of 5 stars0 ratingsWindows 11 For Seniors For Dummies Rating: 0 out of 5 stars0 ratingsRaspberry Pi for Secret Agents - Second Edition Rating: 3 out of 5 stars3/5Evaluation of Some Android Emulators and Installation of Android OS on Virtualbox and VMware 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