Skip to main content
Question

Remotely Font from Every Machine

  • December 15, 2010
  • 6 replies
  • 18 views

Good Morning

Before the end of the week I have to remove any font that contains the word "Avant" off of every machine. Quick Background: MY jobs company font is ITCAvantGardeGothic, even though the techs here install the font on every mac, offer it in self service and have a policy installing it when someone deletes it by mistake, users d/l other versions and install them. These users send company docs with the wrong font and when the directors notice, it falls as a IT fail.

So the workflow would be to search the entire machine, remove any font with the text Avant, and install the correct fonts into the system and user font folders. Have any suggestions? I tried to use a Casper policy to search for fonts but this is pretty limited since it only searches in default font locations. Our users tend to run fonts from some of the most random places. Script ? Policy ? Help ? Thanks ~Joseph
...

HUGE
Joseph Simon / System Administrator
718 233 4016 / F 718 625 5157
www.hugeinc.com

6 replies

Forum|alt.badge.img+31
  • Honored Contributor
  • December 15, 2010

Well, not sure where fonts are installed, stored overall in every system but a simple one liner could do this

sudo find -x -E / -iregex .*.Avant -print

That will go through the system at the root folder and ever sub folder and search for the font, if you know the directory they are installed you could narrow it down to like:

sudo find -x -E /Users/* -iregex .*.Avant -print

Run that command and then later on you can add the -delete option, if it finds what you want so:

sudo find -x -E /Users/* -iregex .*.Avant -print -delete

I used iregex for the regular expression because I believe regex is case sensitive and since some fonts have all sorts of crazy upper and lower case letters in them I figure why not wide card it. I tested it out with Arial but typed it in lower case and got this

find -x -E /Users/* -iregex .*.arial -print /Users/tlarkin/Library/Fonts/Arial

now if I add the -delete it goes bye bye. Please test this several times before pushing out


  • December 15, 2010

How about this as a start:

mdfind "kMDItemFonts == 'vant'"

Has the benefit of finding any font with an internal name rather than looking at filenmes, and finds them anywhere on the system that spotlight has an index of.

--Jim


Forum|alt.badge.img+31
  • Honored Contributor
  • December 15, 2010

Sorry, look at the last example you do need that back slash before you input the word you are looking for. I wrote that out from memory and only tested the last line, sorry about that. I blame it on not finishing my coffee this morning. :)


Forum|alt.badge.img+31
  • Honored Contributor
  • December 15, 2010

Yes, mdfind is great, and you can specify where to search too, like

mdfind -onlyin /Users/* rest_of_your_syntax


  • December 15, 2010

Thanks for the help gentleman.

Before I sent this email I was working with trying to get it done with mdfind.

So I started with

mdfind avant >>> too many results that are not fonts
mdfind avant | grep otf >>> but then realized fonts have many different ext and some don’t even have ext

I tried Jim's suggestions of
mdfind "kMDItemFonts == 'vant'" >>>> no results

Anyone have any suggestions using mdfind.


  • December 15, 2010

Ok maybe I'm missing something with find then

When I try find -x -E / -iregex .*.avant -print >>>>>
it gives no results

and sudo find -x -E /* -iregex .*.avant -print >>>> I get the same result
as you but If I was searching for arial I would need all results like e.g.
ITCArial, Arial Narrow, Arial Black, etc.

Please excuse my noobness when it comes using find. ~Joseph