Tag Archives: Terminal

zsh on macOS 10.15 Catalina

Back when bash was the default shell for macOS, I had updated the .bash_profile file to change the prompt on my computer. Well, that doesn’t work with zsh, it seems.

In bash, I had it set by adding this line to the ~/.bash_profile file. export PS1="\d \t \w   💩  "

Now in zsh is in the ~/.zshrc file, and just copying and pasting that into it didn’t work. It doesn’t seem to like the \ commands. Turns out that it now uses % commands, but it’s not a one to one relationship, so I thought I’d map it out to try to figure out what is what, because Googling didn’t help.

Some of these just show up a number, if you know what it is, comment below, or tweet at me, or hit me up on Slack.

%c shows the current directory (~ or Desktop)

%d shows the full path (/Users/username/Desktop)

%e is showing a 0

%h is showing a 92

%i is showing a 1

%j is showing a 0

%l is showing s003

%m and %M show the computer name

%n and %C show the current user

%t shows the current time in a 12 hour clock

%w shows the current day (Mon 28)

%x and %N show the shell (-zsh)

%y shows the session (ttys001)

%D shows the date (YY-MM-DD)

%I shows 1

%L shows 1

%S seems to have inverted the colours after it.

%T shows the time in a 24 hour clock

%U underlines the text after it

%W shows the date (MM/DD/YY)

Now I set it to export PS1="%D %t %c 💩  "

Find a Mac’s serial number in Recovery Partition or the macOS installer

I couldn’t find this anywhere, so I thought I’d blog about this. Thanks to the #general channel on the MacAdmins Slack for the help.

To find a serial number for a Mac when booted into the Recovery Partition or the macOS installer, to go Utilities and choose Terminal, type in ioreg -rd1 -c IOPlatformExpertDevice | awk -F'"' '/IOPlatformSerialNumber/{print $4}'

That’s it, it will output the serial number for the computer.

NetGear ReadyNAS Time Machine Backup

It seems you cannot mount your Time Machine backup on a ReadyNAS device using normal credentials. Time Machine is segmented off with a special user. Which means I needed to restore my computer using Migration Assistant. It took FOREVER over wifi. However, I seem to be missing my Aperture Libraries. What’s the solution? Assuming it was backed up, I need to find the sparsebundle. It took a lot of searching, but I found it, and will share my brilliance with you in case you ever need to find it, too.


To access: SSH in as root. Then copy the files to a SMB or AFP accessible directory.

cd /data/.timemachine
cp -R * /home/<yourusername>