How to Batch Rename All Files to Lowercase on macOS Using Terminal

If you’ve ever ended up with a folder full of files that have inconsistent capitalization, you’re not alone. This is especially common when working with website files, photo libraries, log files, or transferring data between Windows, Linux, and macOS.

Fortunately, macOS includes everything you need to rename every file in a directory to lowercase with a single Terminal command.

Why Rename Files to Lowercase?

There are several good reasons to standardize filenames:

  • Improve compatibility with Linux and web servers.
  • Prevent case-sensitive file path issues.
  • Make scripting and automation easier.
  • Create a cleaner, more consistent file structure.

This technique is quick, safe, and requires no additional software.

Step 1: Open Terminal

Launch the Terminal application.

You can find it in:

Applications → Utilities → Terminal

Or simply press ⌘ + Space and search for Terminal.

Step 2: Navigate to the Folder

The easiest method is to type:

cd

Add a space after cd, then drag the folder containing your files directly into the Terminal window.

For example:

cd /Users/mac/Documents/MyFiles

Press Enter.

Step 3: Verify You’re in the Correct Folder

Before making any changes, list the files in the directory:

ls

This displays every file in the current folder so you can confirm you’re working in the correct location.

Step 4: Rename Every File to Lowercase

Paste the following command into Terminal and press Enter:

for f in *; do
    mv "$f" "$f.tmp"
    mv "$f.tmp" "$(echo "$f" | tr '[:upper:]' '[:lower:]')"
done

The script performs two operations for each file:

  1. Temporarily renames the file.
  2. Renames it again using the lowercase version of the original filename.

The temporary rename prevents conflicts on case-insensitive filesystems such as macOS.

Step 5: Verify the Results

Run the following command again:

ls

You should now see that every filename has been converted entirely to lowercase.

Example

Before

Photo.JPG
Vacation.PNG
README.TXT
MyDocument.PDF

After

photo.jpg
vacation.png
readme.txt
mydocument.pdf

Things to Keep in Mind

  • This command renames files in the current directory only.
  • It does not rename files inside subfolders.
  • Existing filename extensions are preserved—they’re simply converted to lowercase as well.
  • Always make sure you’re in the correct directory before running bulk rename commands.

Final Thoughts

Using Terminal is one of the fastest ways to standardize filenames on macOS. Whether you’re preparing files for a web server, organizing media, or cleaning up a project directory, this simple one-line command can save a tremendous amount of time.

If you regularly work with large numbers of files, this is a handy Terminal trick worth adding to your toolbox.

Leave a Reply

Your email address will not be published. Required fields are marked *