macOS: Delete .DS_Store files to reset folder settings

The following command will:

  • Only delete .DS_Store files
  • Only in the folder you choose (not its subfolders)
  • Not require your password
  • Not touch system files

In order to run the following commands, the Terminal will have to have access to your storage devices. Read this blog post to learn how to enable Full Disk Access for Terminal.

Step-by-Step Instructions:

  1. Open Terminal
    Press Command + Space, type Terminal, then press Return.
  2. Type find, then a space. Don’t press Return yet.
  3. Drag the folder into the Terminal window.
    This automatically inserts the correct file path — even if the path contains spaces or it’s on an external drive.
    For example, it might look like this:
    find /Volumes/My\ External\ Drive/Some\ Folder
    (You’ll see backslashes \ before spaces — that’s normal.)
  4. Complete the command by adding this to the end:
    -maxdepth 1 -name .DS_Store -delete
    So the full command might look like:
    find /Volumes/My\ External\ Drive/Some\ Folder -maxdepth 1 -name .DS_Store -delete
  5. Press Return. That’s it!
    If there’s a .DS_Store file in that folder, it will be deleted instantly. You won’t get a confirmation message — Terminal just does it.

Quick note about paths:

In the Terminal, spaces are used to separate parts of a command — like the command itself from the options and file or folder names. So if a folder is called My Folder, typing it without any special formatting (like My Folder) will confuse the Terminal into thinking you’re referring to two separate things (“My” and “Folder”). To fix this, you can escape the space with a backslash (\), like this: My\ Folder. This tells the Terminal, “treat the space as part of the name.” Another option is to wrap the entire path in quotes, like "My Folder", which also works. But important: don’t combine the two — a backslash inside quotes (like "My\ Folder") will not work and will actually break the command. Use either backslashes or quotes, but not both.

Examples:

Deleteing “.DS_Store” from the Desktop folder:
find ~/Desktop -maxdepth 1 -name .DS_Store -delete

Deleteing “.DS_Store” from the Documents folder:
find ~/Documents -maxdepth 1 -name .DS_Store -delete

External drive folder (just drag the folder in):
find /Volumes/My\ USB\ Stick/Project\ Files -maxdepth 1 -name .DS_Store -delete

What this does NOT do:
It does not delete anything else.
It does not go into subfolders (so it’s very safe).

On macOS: Enable Full Disk Access for Terminal

This article explains how to enable Full Disk Access for the Terminal application on macOS
(So You Can Safely Work with All Files Even Hidden or Protected Ones)

Why would you do this?

macOS protects certain files and folders (like Mail, Safari, external drives, and some hidden system folders) by default. If you run a command in Terminal and it doesnt seem to work or skips some files it might be because Terminal doesn’t have Full Disk Access.
Giving Terminal Full Disk Access lets it do what you tell it to

Step-by-Step: How to Enable Full Disk Access for Terminal

  1. Open System Settings
    Click the Apple menu in the top-left corner.
    Choose System Settings (or System Preferences on older macOS versions).
  2. Go to Privacy & Security
    In the left-hand sidebar, scroll down and click Privacy & Security.
    On the right side, scroll down until you see Full Disk Access and click it.
  3. Add Terminal to the list
    Click the + (plus) button at the bottom of the list.
    A file picker will appear. Press Command + Shift + G (or navigate manually).
    In the “Go to the folder” box, type:
    /System/Applications/Utilities/
    Press Return, then select Terminal.app, and click Open.
    You’ll now see Terminal in the list, with the toggle turned on (or you’ll need to turn it on yourself).
  4. Restart Terminal (just to be safe)
    Activate the Terminal app, the quit the Terminal app completely (press Command + Q while its focused).
    Then reopen it as normal.

Important Notes:

You only need to do this once.
This does not give Terminal uncontrolled access to your Mac it just lets you, the user, tell Terminal to access protected folders if needed.
Of course, still be very careful with commands when Full Disk Access is enabled Terminal can now read/write more files than before, especially commands you copy from pages on the internet!

Special security note example:

Copy-pasting curl commands from the internet can be extremely risky because they can download and run unknown code on your system sometimes with full permissions. For example, a popular and benign command to install Pi-hole looks like this:

curl -sSL https://install.pi-hole.net | bash

While this works and is safe if you trust the source (in this case the developers of pihole), you’re essentially letting a remote server run code on your computer without seeing what it is first. A malicious site could do the same but install malware, steal data, or damage your system.

Note: The | symbol (this is not the uppercase letter I as in Ian or the lower case “l” as in letter) is called a pipe, it takes the output of one command (in this case, the download from curl which is a script that handles the full installation of the pi-hole service!) and feeds it directly into another command (bash), which runs it. This is powerful but highly dangerous if misused.

Mars in 8K

As much as I appreciate the technical achievement of how we are able to create these images and this footage I have to say:

I love our planet brimming with life everywhere. And I just cannot understand why we destroy it the way we do. We only have this one. There is no other feasible alternative planet for the foreseeable future. Probably even further than that.

 

The Case Against Crypto

So if you sell your crypto and make a profit in dollars, it’s exactly because a greater fool bought it at a higher price than you did. So every dollar that comes out of a cryptocurrency is because a later investor put a dollar in. They are inherently zero-sum by design, and when you take into account the casino (i.e. exchanges and miners) taking a rake on the game then the entire structure becomes strictly negative-sum. For every winner there are guaranteed to be multiple losers. It’s a game rigged by insiders by hacking human psychology.
www.stephendiehl.com/blog/against-crypto.html