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
Powershell: The ultimate beginner's guide to Powershell, making you a master at Windows Powershell command line fast! Rating: 5 out of 5 stars5/5Mac Unlocked: Everything You Need to Know to Get Cracking in macOS Big Sur Rating: 0 out of 5 stars0 ratingsThe Windows Command Line Beginner's Guide: Second Edition Rating: 4 out of 5 stars4/5Let's Use BASH on Windows 10! Rating: 0 out of 5 stars0 ratingsmacOS Black Book: Mastering Shortcut Keys Rating: 0 out of 5 stars0 ratingsWindows Command Prompt A-N Rating: 5 out of 5 stars5/5Going Text: Mastering the Command Line Rating: 4 out of 5 stars4/5Windows Command Prompt Rating: 0 out of 5 stars0 ratingsBash Command Line Pro Tips Rating: 5 out of 5 stars5/5Linux Command-Line Tips & Tricks Rating: 0 out of 5 stars0 ratings20 Windows Tools Every SysAdmin Should Know 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 ratingsLearning Linux Shell Scripting Rating: 4 out of 5 stars4/5Arch Linux: Fast and Light! Rating: 3 out of 5 stars3/5Linux Commands By Example Rating: 5 out of 5 stars5/5The Complete Powershell Training for Beginners Rating: 0 out of 5 stars0 ratingsWindows Batch File Programming Rating: 2 out of 5 stars2/5An Ultimate Guide to Kali Linux for Beginners Rating: 3 out of 5 stars3/5Macintosh OS X Interview Questions, Answers, and Explanations: Macintosh OS X Certification Review 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 ratingsBash for Fun: Bash Programming: Principles and Examples Rating: 0 out of 5 stars0 ratingsWorking with Linux – Quick Hacks for the Command Line Rating: 5 out of 5 stars5/542 Astoundingly Useful Scripts and Automations for the Macintosh Rating: 0 out of 5 stars0 ratingsmacOS High Sierra: Up To Speed Rating: 0 out of 5 stars0 ratingsConfigMgr - An Administrator's Guide to Deploying Applications using PowerShell Rating: 5 out of 5 stars5/5Basics with Windows Powershell Rating: 0 out of 5 stars0 ratingsLinux: Learn in 24 Hours Rating: 5 out of 5 stars5/5Node.js: Tools & Skills Rating: 0 out of 5 stars0 ratings
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/5Mastering Windows PowerShell Scripting Rating: 4 out of 5 stars4/5Windows 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 ratingsMake Your PC Stable and Fast: What Microsoft Forgot to Tell You Rating: 4 out of 5 stars4/5The Linux Command Line Beginner's Guide Rating: 4 out of 5 stars4/5Windows 11 For Dummies Rating: 0 out of 5 stars0 ratingsHacking for Beginners: Mastery Guide to Learn and Practice the Basics of Computer and Cyber Security Rating: 0 out of 5 stars0 ratingsLinux for Beginners: Linux Command Line, Linux Programming and Linux Operating System Rating: 4 out of 5 stars4/5Tor Darknet Bundle: Master the Art of Invisibility Rating: 0 out of 5 stars0 ratingsLinux: Learn in 24 Hours Rating: 5 out of 5 stars5/5Essential iPhone iOS 12 Edition: The Illustrated Guide to Using iPhone Rating: 0 out of 5 stars0 ratingsUNIX For Dummies Rating: 3 out of 5 stars3/5Networking for System Administrators: IT Mastery, #5 Rating: 5 out of 5 stars5/5iPhone Unlocked Rating: 0 out of 5 stars0 ratingsPages For Seniors: A Ridiculously Simple Guide To Word Processing On Your Mac Rating: 0 out of 5 stars0 ratingsDarknet Rating: 4 out of 5 stars4/5Hacking : The Ultimate Comprehensive Step-By-Step Guide to the Basics of Ethical Hacking Rating: 5 out of 5 stars5/5iPad and iPad Pro For Dummies Rating: 0 out of 5 stars0 ratingsHacking Essentials - The Beginner's Guide To Ethical Hacking And Penetration Testing Rating: 3 out of 5 stars3/5CompTIA Linux+ Study Guide: Exam XK0-004 Rating: 0 out of 5 stars0 ratingsMacs All-in-One For Dummies Rating: 0 out of 5 stars0 ratingsWindows Registry Forensics: Advanced Digital Forensic Analysis of the Windows Registry Rating: 4 out of 5 stars4/5Bash Command Line Pro Tips 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/5Raspberry Pi Cookbook for Python Programmers Rating: 0 out of 5 stars0 ratingsExploring Windows 11: The Illustrated, Practical Guide to Using Microsoft Windows Rating: 0 out of 5 stars0 ratingsRaspberry Pi for Secret Agents - Second Edition Rating: 3 out of 5 stars3/5
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