locate is a command I’ve used in the past, but now, fresh installed with sudo apt get locate it doesn return anything.

locate --version returns locate (GNU findutils) 4.10.0, from 2024

or, have I forgotten something?

  • interdimensionalmeme@lemmy.ml
    link
    fedilink
    arrow-up
    3
    ·
    23 hours ago

    using find to sort all pictures in /pics/ by inverted (i.e., most recently accessed first) access time, and filtering only those with an exposure time between 1/20 and 1/100 seconds

    find /pics/ -type f \( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' \) \
      -exec exiftool -ExposureTime -T {} \; -exec bash -c '
        file="$1"
        exposure="$2"
    
        # Convert exposure to decimal
        if [[ "$exposure" =~ ^([0-9]+)/([0-9]+)$ ]]; then
            num="${BASH_REMATCH[1]}"
            denom="${BASH_REMATCH[2]}"
            exposure_val=$(echo "$num / $denom" | bc -l)
        else
            exposure_val="$exposure"
        fi
    
        # Filter by exposure between 1/100 and 1/20 seconds
        if (( $(echo "$exposure_val >= 0.01" | bc -l) )) && (( $(echo "$exposure_val <= 0.05" | bc -l) )); then
            atime=$(stat -c %X "$file")  # Access time (epoch)
            echo "$atime $file"
        fi
      ' bash {} $(exiftool -s3 -ExposureTime {}) | sort -nr
    

    In voidtools everything it would be

    pic: path:"C:\pics" sort:da-descending ExposureTime:1/20..1/100

    But actually doesn’t work because “ExposureTime” is only available as an sorting order not a filter but you get the gist ;)