Rosetta 2 doesn’t install automatically on an ARM-based mac without X86-64 apps. If you try to run an Intel-only binary on an Apple Silicon chip, the default message will be :
This change will add the “Anywhere” option for opening apps to the Security preference panel in macOS Sonoma and Sequoia, which is hidden by default otherwise.
sudo spctl --master-disable
You’ll see a confirmation reported back stating: “Globally disabling the assessment system needs to be confirmed in System Settings.”
In general you can use the mdfind (MetaData Find) command to (very) quickly search for files.
The mdfind command consults the central metadata store and returns a list of files that match the given metadata query. The query can be a string or a query expression.
This will recursively traverse the /path/to/folder directory and list only the symbolic links:
ls -lR /path/to/folder | grep '^l'
If your intention is to follow the symbolic links too, you should use your find command but you should include the -L option; in fact the find man page says:
-L Follow symbolic links. When find examines or prints information
about files, the information used shall be taken from the prop‐
erties of the file to which the link points, not from the link
itself (unless it is a broken symbolic link or find is unable to
examine the file to which the link points). Use of this option
implies -noleaf. If you later use the -P option, -noleaf will
still be in effect. If -L is in effect and find discovers a
symbolic link to a subdirectory during its search, the subdirec‐
tory pointed to by the symbolic link will be searched.
When the -L option is in effect, the -type predicate will always
match against the type of the file that a symbolic link points
to rather than the link itself (unless the symbolic link is bro‐
ken). Using -L causes the -lname and -ilname predicates always
to return false.
Then try this:
find -L /var/www/ -type l
This will probably work: I found in the find man page this diamond: if you are using the -type option you have to change it to the -xtype option:
l symbolic link; this is never true if the -L option or the
-follow option is in effect, unless the symbolic link is
broken. If you want to search for symbolic links when -L
is in effect, use -xtype.
In macOS, when a key is held down while entering text, a popup is shown which lets one choose between various accented forms of the character. To disable this execute the following command line in the Terminal :
To avoid getting a ‘Installation Failed’ message, you need to change the date before installing :
date {month}{day}{hour}{minute}{year}
Set the Mac’s date to a date right around the time of release of the OS, e.g.
10.7 : Mac OS X Lion was released on July 20, 2011.
10.8 : OS X Mountain Lion was released on July 25, 2012.
10.9 : OS X Mavericks was released on October 22, 2013.
10.10 : OS X Yosemite was released on October 16, 2014.
10.11 : OS X El Capitan was released on September 30, 2015.
10.12 : macOS Sierra was released on September 20, 2016.
10.13 : macOS High Sierra was released on September 25, 2017.
10.14 : macOS Mojave was released on September 24, 2018.
10.15 : macOS Catalina was released on October 7, 2019.
11 : macOS Big Sur was released November 12, 2020.
12 : macOS Monterey was released on October 25, 2021.
When creating an Intel install media on an ARM-based Mac, the OS expects the createinstallmedia executable to be signed before running, but the Apple-made program isn’t. You’ll encounter a zsh : killed. error otherwise. Sign the program with the following :
On OSX, the native ssh-add client has a special argument to save the private key’s passphrase in the OSX keychain, which means that your normal login will unlock it for use with ssh. On OSX Sierra and later, you also need to configure SSH to always use the keychain (see Step 2 below).
Alternatively you can use a key without a passphrase, but if you prefer the security that’s certainly acceptable with this workflow.
Step 1 – Store the key in the keychain
Just do this once:
ssh-add -K ~/.ssh/[your-private-key]
Enter your key passphrase, and you won’t be asked for it again.
(If you’re on a pre-Sierra version of OS X, you’re done, Step 2 is not required. In versions of macOS before Monterey, use --apple-use-keychain instead of -K)
Step 2 – Configure SSH to always use the keychain
It seems that OSX Sierra removed the convenient behavior of persisting your keys between logins, and the update to ssh no longer uses the keychain by default. Because of this, you will get prompted to enter the passphrase for a key after you upgrade, and again after each restart.
The solution is fairly simple, and is outlined in this github thread comment. Here’s how you set it up:
Ensure you’ve completed Step 1 above to store the key in the keychain.
If you haven’t already, create an ~/.ssh/config file. In other words, in the .ssh directory in your home dir, make a file called config.
In that .ssh/config file, add the following lines:
Change ~/.ssh/id_rsa to the actual filename of your private key. If you have other private keys in your ~.ssh directory, also add an IdentityFile line for each of them. For example, I have one additional line that reads IdentityFile ~/.ssh/id_ed25519 for a 2nd private key.
The UseKeychain yes is the key part, which tells SSH to look in your OSX keychain for the key passphrase.
That’s it! Next time you load any ssh connection, it will try the private keys you’ve specified, and it will look for their passphrase in the OSX keychain. No passphrase typing required.
One thing that can be problematic when working with any shared storage is the existence of .DS_Store files on the network share, since these are intended for a single workstation’s use.
Enabling a policy to prevent the creation of .DS_Store files on network shares can speed up directory browsing (as described in this article) and prevent permission errors when moving/deleting files.
To prevent the Mac workstation from creating .DS_Store files on network shares, as well as instruct it to ignore existing .DS_Stores, open Terminal and enter:
When working on network drives with Mac OS X every Mac user will by default create .DS_Store files. Those files are used by OS X to store custom attributes like icon positions. For more info on .DS_Store files read this article.
To prevent those files from being created:
Open up the Terminal
Run the following command defaults write com.apple.desktopservices DSDontWriteNetworkStores true
Restart your Mac or log out and back in.
Those .DS_Store files will now only be created on local volumes any you no longer have Windows users yelling at you about them. 😉
With macOS Catalina, Apple is now using Zsh as the default shell. We love Zsh, but the trusty old Bash shell is still included with macOS, and you can quickly switch back to Bash if you prefer.
Zsh is only the default shell on newly created user accounts, so any existing accounts you have on an upgraded Mac will still use Bash by default unless you change it. Each user account has its own default shell preference.
From the Terminal
To change a user account’s default shell on macOS, simply run the chsh -s (change shell) command in a Terminal window.
Change the default shell to Bash by running the following command:
chsh -s /bin/bash
You’ll have to enter your user account’s password. Finally, close the Terminal window and reopen it. You’ll be using Bash instead of Zsh.
Change the default shell back to Zsh by running this command:
chsh -s /bin/zsh
Enter your password when prompted. After you close the terminal window and reopen it, you’ll be using Zsh.
You can see a list of included shells you can select by running the following command:
cat /etc/shells
From System Preferences
You can also change this option graphically from System Preferences if you prefer.
Head to System Preferences > Users & Groups on your Mac. Click the lock icon and enter your password. Hold the Ctrl key, click your user account’s name in the left pane, and select “Advanced Options.”
Click the “Login Shell” dropdown box and select “/bin/bash” to use Bash as your default shell or “/bin/zsh” to use Zsh as your default shell. Click “OK” to save your changes.
Bash on macOS Is Still Outdated
Note that the version of Bash (Bourne Again SHell) included with macOS is still pretty outdated, however. If you run bash --version , you’ll see that Catalina includes Bash 3.2.57 when Bash 5.0 is the latest version. Newer versions are licensed under the GPLv3 license, while Apple still distributes a version licensed under GPLv2.
In contrast, the version of Zsh (Z shell) included with macOS (check with zsh --version ), is Zsh 5.7.2, which is the latest version at the time of Catalina’s release.
On OSX, the native ssh-add client has a special argument to save the private key’s passphrase in the OSX keychain, which means that your normal login will unlock it for use with ssh. On OSX Sierra and later, you also need to configure SSH to always use the keychain (see Step 2 below).
Alternatively you can use a key without a passphrase, but if you prefer the security that’s certainly acceptable with this workflow.
Step 1 – Store the key in the keychain
Just do this once:
ssh-add -K ~/.ssh/[your-private-key]
Enter your key passphrase, and you won’t be asked for it again.
(If you’re on a pre-Sierra version of OSX, you’re done, Step 2 is not required.)
Step 2 – Configure SSH to always use the keychain
It seems that OSX Sierra removed the convenient behavior of persisting your keys between logins, and the update to ssh no longer uses the keychain by default. Because of this, you will get prompted to enter the passphrase for a key after you upgrade, and again after each restart.
Ensure you’ve completed Step 1 above to store the key in the keychain.
If you haven’t already, create an ~/.ssh/config file. In other words, in the .ssh directory in your home dir, make a file called config.
In that .ssh/config file, add the following lines: Host * UseKeychain yes AddKeysToAgent yes IdentityFile ~/.ssh/id_rsa Change ~/.ssh/id_rsa to the actual filename of your private key. If you have other private keys in your ~.ssh directory, also add an IdentityFile line for each of them. For example, I have one additional line that reads IdentityFile ~/.ssh/id_ed25519 for a 2nd private key. The UseKeychain yes is the key part, which tells SSH to look in your OSX keychain for the key passphrase.
That’s it! Next time you load any ssh connection, it will try the private keys you’ve specified, and it will look for their passphrase in the OSX keychain. No passphrase typing required.
When you take a screenshot with Mojave or Catalina using Command+Shift+3, 4 or 5, you get a thumbnail of the image in the lower right corner for a few seconds.
This can be handy if you want to access the image by clicking it, without needing to find the file.
But if you’d rather not have the thumbnail, you can turn it off.
Use Command+Shift+5 and then click on the Options button that appears in the controls.