2

I created an SVG image a few months ago.

Recently I found the file is lost, but I don't think I deleted it.

I need to know how can I find this file by setting up these filters:

  1. only search for files that were created in the past 8 months.
  2. only search for files that are less than 20kb.
  3. search keywords "XXXX" (which I am sure is in that file) that existed in these qualified files.

Is there any way I can do this? Any solution is welcome.

3 Answers 3

6

A simple Finder Spotlight search can do this. Navigate to the Folder you want to start the search from. Type Command F, and then enter the search criteria:

enter image description here

I'm not sure what you mean by keywords: do you mean metadata describing the file, or some actual text in the SVG? You could try the "Contents" token for the latter.

2

You can use Find Any File app as seen below https://apps.tempel.org/FindAnyFile/index.php

enter image description here

1

Try this from terminal also if you want to get a file of search in txt too:

 find . -name '*.svg' -type 'f' -size -20k -newermt 2019-04-23 -not -newermt 2019-12-28 > findlist.txt

Note: the - before 20k. Just 20k means exactly 20 kilobytes. -20k means smaller than 20 kilobytes. +20k means larger than 20 kilobytes.

The -type 'f' forces the command to only act on files and skip directories. this would avoid errors if the path contains folders with names that match the pattern *.svg.

If you want to filter size in bytes (as in 20 bytes instead of 20 kilobytes) then you have to write it like this: 20c. If you just write 20 it will be interpreted as 20*512 bytes. This is a strange requirement by POSIX.

4
  • In which path should I run this command? Dec 23, 2019 at 11:59
  • You can run from anywhere, if you want to search system folder then run from your system but save the files on /Users/xxx/Desktop as it will not allow writing file on the system. or if you want to search only your user folder, then run from your user path.
    – Udhy
    Dec 23, 2019 at 12:07
  • Do you really need to run sudo?
    – benwiggy
    Dec 23, 2019 at 12:13
  • No :) , really no need of it. Let me modify it.
    – Udhy
    Dec 23, 2019 at 12:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .