camdencheek / fre

Command line frecency tracking
MIT License
121 stars 8 forks source link

Remove deleted files / directories #18

Closed HaleTom closed 2 years ago

HaleTom commented 2 years ago

How can I easily remove deleted files / directories from the output?

Ideally I could run a command to remove all of these, or only entries that match a glob or regex.

HaleTom commented 2 years ago

Ah, I just saw the following in README:

# Purge directories that no longer exist
fre --sorted | while read dir ; do if [ ! -d "$dir" ] ; then fre --delete "$dir";  fi ; done

Just change to ! -e for existence check, and use a better variable name like $entry.

camdencheek commented 2 years ago

Glad the readme example helped!