Macworld - USA (2021-08)

(Antfer) #1
AUGUST 2021 MACWORLD 141

This image shows the change from Mojave: In the Finder in Big Sur, you no longer see that
lock indicator.


Prior to Big Sur, a locked file would
have a lock image overlaid on its icon in
the Finder. Big Sur only shows that lock
overlay in the Get Info dialog box.
Once the file is locked, it can be
moved around in the Finder, but not
renamed or modified via apps. It can
also be deleted, but only if you confirm
the operation.
Apple’s apps and those of third parties
that support the convention also let you
lock and unlock documents from the
titlebar: Click the downward-pointing arrow
to the right of the file name and then select
or deselect the Locked checkbox.


Using the Terminal
If you like to poke at macOS’s internals via
Terminal, launch Applications → Utilities →
Terminal and navigate to a folder that
you’ve locked an item in. If your file is on
the Desktop, you can type this to get there:
cd ~/Desktop
macOS reveals the lock status with a
special flag on the Unix file-listing


command, ls. Enter the following (that’s
a capital letter O there):
ls -lO front_door.jpeg
You can replace front_door.jpeg
with an asterisk (*) to list everything in
the directory, use another specific
filename or enter a wildcard pattern, like
license*, which matches all files and
folders starting with “license.” The same
is true for the file name example in all the
below cases.
Terminal will show you the term uchg
as a “flag” for any locked file, as in:
-rw-r--r--@ 1 gif staff uchg
150293 Mar 8 2020 front_door.jpeg
To lock and unlock a file in the Finder,
you can directly modify that uchg flag:
> To lock a file: chflags uchg
front_door.jpeg
> To unlock a file: chflags nouchg
front_door.jpeg
If you want yet another method, you
can use SetFile, which lets you change
attributes on a file:
> To lock a file: SetFile -a L
Free download pdf