Da li ste znali za ‘mdfind’ komandu?
Posted: 20 October 2014 09:32 AM
Sr. Member
Avatar
RankRankRankRank
Total Posts:  537
Joined  2008-03-04

Skoro sam saznao da pored standardne find komande (koja je dostupna i na drugim UNIX sistemima); OS X ima i mdfind komandu, koja koristi Spotlight za pretraživanje i pretražuje i skrivene direktorijume (koje Spotlight obično ne prikazuje kada se nešto traži preko njegovog GUI-ja).

Korisna stvar ako imate potrebu da tražite sistemske fajlove.

Evo uputstvo (koje se dobija kada se ukuca man mdfind).

[code:1]    -literal   Force the provided query string to be taken as a literal query string,
            without interpretation.

    -interpret Force the provided query string to be interpreted as if the user had
            typed the string into the Spotlight menu.  For example, the string
            ‘search’ would produce the following query string:
                (* = search* cdw || kMDItemTextContent = search* cdw)

EXAMPLES
    The following examples are shown as given to the shell.

    This returns all files with any metadata attribute value matching the string
    ‘image’:

        mdfind image

    This returns all files that contain ‘MyFavoriteAuthor’ in the kMDItemAuthor meta-
    data attribute:

        mdfind ‘kMDItemAuthors == ‘*MyFavoriteAuthor*’‘

    This returns all files with any metadata attribute value matching the string
    ‘skateboard’.  The find continues to run after gathering the initial results, pro-
    viding a count of the number of files that match the query.

        mdfind -live skateboard

    To get a list of the available attributes for use in constructing queries, see
    mdimport(1); particularly the -X switch.

SEE ALSO
    mdimport(1); mdls(1); mdutil(1); xargs(1)[/code:1]

 Signature 

Bill: What"s that? > Jobs: It"s an iHouse! > Bill: But it"s got no windows!? > Jobs: Exactly! Hahhahaha! 😊

Profile
 
Posted: 20 October 2014 11:11 PM   [ # 1 ]
Sr. Member
Avatar
RankRankRankRank
Total Posts:  7582
Joined  2005-04-28

Da, znao sam. B)

 Signature 

ACSP 10.10 - ACSP 10.9 - ACA 10.8 Mac Management - ACSP 10.8 -  ACSP 10.7 - ACSA 10.6

Profile