View age of password

Evgenii Sovetkin e.sovetkin at gmail.com
Wed Sep 27 11:27:30 CEST 2017


> I'm new to pass and I was wondering, is there a way to view how old a pass is? 
> (or the creation date of it).

If you are using git with your pass, then you can run something like
this. It determines the age of the first line of the password file.

print_age() {
    filename="$1"

    cur_time=$(date --date="now" +"%s")
    ch_time=$(git blame -L 1,1 "${filename}" --porcelain --date=relative | sed -n 's/^committer-time //p')
    alt=$(echo "(${cur_time} - ${ch_time})/(60*60*24)" | bc)

    echo "${alt} days - ${filename}"
}
export -f print_age
parallel print_age ::: $(git ls-tree -r --name-only HEAD)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.zx2c4.com/pipermail/password-store/attachments/20170927/e855915d/attachment.asc>


More information about the Password-Store mailing list