Sometimes I use an external drive with macOS on it. This is in conjunction to my current internal drive which also is running macOS.
I find it annoying that, whenever I search for something (such as an application) when I'm in either OS when the external drive is connected, I get results from both my external and internal drive. However, I am only interested in running the application from the drive I've booted off of.
I tried circumventing this issue while on my external drive by creating a Spotlight exception for internal drive. This prevented files and apps from my internal drive from showing up. However, this also prevents me from searching for files on my internal drive, when I'm booted off my internal drive! Clearly this is something that I don't want.
It seems as though the Spotlight exclusions are per drive, which is not ideal in this scenario.
Is there a way to make Spotlight index only the drive which is currently booted? In this way when I'm booted off my external drive I'll get results only from the external drive, and same with the internal drive.
rm
command requires that I run it usingsudo
. I'm using the first method in the SO link you posted. Would you happen to have any suggestions for that? Do I need to use the launch daemon method to overcome this? – Oion Akif Feb 15 '17 at 14:24DriveToHide
has spaces, then your scripts, as currently written, will fail. If you are going to test with[ ... ]
then double quote the variables to prevent blobbing and word splitting. Or use[[ ... ]]
to test, then double quoting isn't necessary. – user3439894 Feb 17 '17 at 02:33