Bash – Firefox Profile Locations

Bash
#!/bin/bash

# You can add to this list by opening up Firefox and going to "about:profiles"
locations=(
	"$HOME/.mozilla/firefox"                             # Main profile data (bookmarks, history, extensions)
	"$HOME/.cache/mozilla/firefox"                       # Cache data
	"$HOME/snap/firefox/common/.mozilla/firefox"         # Snap package profile location
	"$HOME/flatpak/org.mozilla.firefox/.mozilla/firefox" # Flatpak profile location
	"$HOME/Library/Application Support/Firefox"          # macOS HomeBrew Root Directory
	"$HOME/Library/Caches/Firefox/"                      # macOS HomeBrew Local Directory
)

echo "Searching for Firefox profiles..."
for dir in "${locations[@]}"; do
	if [ -d "$dir" ]; then
		echo "Profiles in: $dir"
		find "$dir" -maxdepth 1 -type d -name "*.default*" -o -name "*.dev-edition-default" -o -name "*.default-release"
	fi
done
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.