• tequinhu@lemmy.world
    link
    fedilink
    arrow-up
    7
    arrow-down
    1
    ·
    edit-2
    14 days ago

    grep -irl "some text that the file would have"

    (Obiously only work for text files, but that’s enough to cover 90% of cases for me)

    • kabi@lemm.ee
      link
      fedilink
      arrow-up
      2
      ·
      14 days ago

      spends ten minutes figuring out which one’s the latest

      has to save it again

      “new (actual)(for real)”

    • toynbee@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      14 days ago

      I used to have this problem, but now I go with one of two solutions:

      • filename-$(date +%F) (or similar)
        • example: notes-2024-12-14.txt
        • can be expanded to include further time details if more than one iteration per day is released
      • filename-Mk#
        • example: product-design-MkII (Or Mk2 if you prefer)
        • pretty much infinitely expandable and you always know which is latest
        • admittedly I’m pretty sure most systems wouldn’t sort Roman numerals correctly, but I rarely have enough iterations of anything to worry about it

      edit: Also, with either, you could pretty easily write a script that would symlink something like filename-latest to the newest one, but depending on how you’re generating the files in question, that might be less viable.