See File Metadata Query Expression Syntax and for using other search operators. To avoid opening bash scripts or other non-document files, you may restrict file contents by additional search attributes. Additional cd is for case insensitive and ignoring diacritical marks, e.g., fred will return both, Frédéric and FrEDeric.įindpaper will restrict search to results under a specific path (recursive) while openpaper pie*201 will open a (or first of multiple results) search result or openpaper pie*201 3 will open third result entry. There is no need to prepend or append * to your query as the search pattern, '*$1*' already tags wild card entry at beginning and end of your query. To search for files with words, pie and 2016 anywhere in the file name, do spot pie*2016 #or Now, either source ~/.bash_aliases or open a new terminal load functions. You can also use the Finder to rename and delete files, create new folders, and move files around in your OneDrive folder. Open "$(mdfind -name -onlyin "/Users/foo/articles" "kMDItemDisplayName='*$1*'cd" | sed -n "$")" Find Any File searches your local and network disks for files by name, creation or modification date, size or kind. # default to open the first entry unless 2nd positional argument is given Mdfind -onlyin "/Users/foo/articles" "kMDItemDisplayName='*$1*'cd" # restrict to files under (recursive) a specific path # find any item matching search query in file name I find this easier than typing long string of query in spotlight window.Īdd following functions in ~/.bash_aliases. You may use following command line functions to quickly find and open relevant file. The simplest way (which I'm sure you've already tried, but hey, let me add it to the thread anyway) is to enter abc.dmg into the search box on the top right of any finder window, then select 'File Name' from the options on the Search Bar that appears.
0 Comments
Leave a Reply. |