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.”

Why is my MacBook warm when the lid is closed (in sleep mode)?

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)

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:

sed on macOS: How to append multiple lines of text to an HTML or XML file alvin December 19, 2017 - 3:40pm

As a brief note about the Linux/Unix sed command, today I learned how to append multiple lines of text to an HTML (or XML) file on macOS. The short answer is that I created a sed commands file named changes.sed with these contents:

How to change the Mac Terminal title from the command line

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

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.