mac-os-x

recent posts related to the mac os x operating system

Mac crontab: Creating MacOS startup jobs with crontab, er, launchd

Table of Contents1 - macOS: crontab, launchd, and launchctl2 - Running a simple command every minute with Mac launchd3 - 1) Move to the $HOME/Library/LaunchAgents directory4 - 2) Create a Mac plist file to describe your job5 - 3) Tell MacOS about your Mac plist launchd file6 - 4) How Mac launchd works with system reboots7 - An important note about root and sudo access8 - MacOS launchd, launchctl, and plist resources9 - MacOS startup jobs: cron and crontab, launchd and launchctl

MacOS crontab FAQ: How do I run a Unix job (or shell script) through the MacOS crontab facility? I keep trying to edit my Mac crontab file, but my Mac won't save my crontab changes, or run my program.

Back to top

macOS: crontab, launchd, and launchctl

Way back when (~2012-2014), I found that the Mac crontab command was deprecated on MacOS, and the Apple documentation encouraged you to use their launchd facility. Here’s a blurb from Apple's crontab man page:

“Darwin note: Although cron(8) and crontab(5) are officially supported under Darwin, their functionality has been absorbed into launchd(8), which provides a more flexible way of automatically executing commands. See launchctl(1) for more information.”

How to Start the Mac Screen Saver with a Keyboard Shortcut in MacOS alvin March 24, 2018 - 5:27pm

This is a decent article about how to start the Mac/MacOS screensaver using a keyboard shortcut (keystroke).

Why is my MacBook warm when the lid is closed (in sleep mode)? alvin March 22, 2018 - 12:29pm
Table of Contents1 - Troubleshooting2 - My solution3 - Possible problem: Energy Saver settings4 - Possible problem: Bluetooth settings5 - More information6 - Summary

When I woke up last night it was a little windy outside, so I decided to unplug my MacBook Pro because the power tends to flicker here. When I picked up the MacBook I noticed that it was very warm, even though the lid was closed and it was in sleep mode. This morning I decided to dig into the “Why is my MacBook hot even though the lid is closed and it’s in sleep mode” question.

How to show the largest files under a directory on Mac OS X (Unix) alvin December 23, 2017 - 1:00pm

Here’s an example that shows how to find the largest files under a directory on MacOS and Linux/Unix systems.

A du/sort command to show the largest files under a directory on Mac OS X

The Unix/Linux command that worked for me on my MacOS system is this:

$ du -a * | sort -r -n | head -10

du is the disk usage command, and the -a flag says, “Display an entry for each file in a file hierarchy.” Then I use the sort command to sort the du output numerically and in reverse. After that, head -10 shows only the first ten lines of output. In the Music folder on my Mac the command and output look like this:

How to change the Mac Terminal title from the command line alvin December 14, 2017 - 9:23am

Mac Terminal FAQ: How can I change the title on the Mac Terminal app from the Mac/Unix command line?

I've been working on a project where I have three Mac Terminal tabs open at one time, and I found it was much easier to work this way when I changed the title on each Terminal window. This helped me easily identify what I was doing in each Terminal window.

Changing the Mac Terminal title

The basic escape sequence you need to change the Terminal title from the command line is this:

MacOS screen annotation/presentation software alvin August 28, 2017 - 6:00pm

I was going to write a little application to let me annotate my MacOS screen during presentations, but the Ink2Go product looks like it does exactly what I was thinking. As I’m creating a video presentation, such as when showing how to write some Scala or Android code, I want to be able to draw on the screen, such as writing text, arrows, circles, and boxes to highlight parts of the screen. Ink2Go looks like what I want.

Developing an OSX Application in Java alvin August 16, 2017 - 9:39am

This is a good guide for things to be aware of when creating Mac/macOS applications using Java. It mostly includes a lot of information about the com.apple.eawt.AppEvent library/classes.

Apple: Maintaining Your Signing Identities and Certificates alvin August 16, 2017 - 9:28am

As a note to self, this apple.com Maintaining Your Signing Identities and Certificates page contains information on signing identities, certificates, provisioning profiles, developer accounts, developer id certficates, the keychain access app, exporting certificates, and more.