How to create a directory in root on Catalina or Big Sur

Frank
Jan 5, 2021

Sometimes we need to create a directory in root, but we don’t allow to write the root directory since Catalina and Big Sur. Apple provides another way to realise this purpose, by modifying the file:

/etc/synthetic.conf

e.g. I first create a folder in my home directory:

/Users/testuser/Qt

after then added the following entry in order to create a symbol link to /Qt

Qt    Users/frank/Qt

Attension: the separator is Tab not space!!!!, after then save the file and reboot the system, you will see Qt has already been in the root directory.

testuser@Testers-MacBook-Pro / % pwd/testuser@Testers-MacBook-Pro / % lsApplications Qt  Users  bin  dev  home  private  tmp  varLibrary  System  Volumes  cores  etc  opt  sbin  usr

It works for Catalina and Big Sur.

--

--

Frank
0 Followers

A C/C++ programmer has a strong curiosity with new technology (e.g. Go, Dart, Apex).