Is there a way to have it stop doing this? Its an old G4 and I sometimes use a toshiba 4GB usb drive to transfer files.
For spotlight indexing you can easily disable it by adding the usb volumes in the privacy tab. for other hidden files check this thread https://forums.macrumors.com/threads/solved-prevent-hidden-files-creation-on-usb-drives.2022099/ Panagiotis
@pandlouk Though I'm very much a privacy advocate I've never had to manage my Mac that way as I'm the sole user and it never sees the net. Thanks for your input.
You can, of course, make use of the macOS user defaults system via the defaults write syntax if you know the proper variable to change (many of which are shown in the MacRumors forum thread referenced by pandlouk). However, I honestly think it is just easier to leaves the defaults as is and clean out the junk files after the fact with one of the many utilities, such as USBClean, BlueHarvest, and/or CleanMyDrive2. I personally prefer CleanMyDrive2. It's free on the Mac App Store as long as you don't want to purchase custom disk icons (in-app purchase), its a handy way to show drive utilization, cleans both Mac and Windows junk files, and provides another super easy way to unmount / eject your drive(s).