Are there any CLI tools like zoxide that allow to quickly find recently opened files by fuzzy search instead of directories?

  • Eager Eagle@lemmy.world
    link
    fedilink
    English
    arrow-up
    5
    ·
    1 year ago

    fzf + Ctrl+R

    then I type part of the path, basename, or just my CLI editor and browse the recent commands.

  • PumpkinDrama@reddthat.comOP
    link
    fedilink
    arrow-up
    3
    ·
    edit-2
    1 year ago

    Related idea:

    https://reddthat.com/post/7516312

    To manage temporary files in Linux, a Bash script can move files untouched for 10 days to a timestamped subfolder, return modified files to the root, and delete files not modified for 90 days. Alternatively, a folder with symlinks to recently accessed files can be created using mkdir, find with -atime -7 to locate recently accessed files, and a while loop with ln -s to symlink each file into the folder. Both approaches help organize files based on access time to avoid clutter and remove stale temporary files. The Bash script offers more automation while the symlink folder provides a manual way to access recent files.

  • Ordoviz@lemmy.ml
    link
    fedilink
    arrow-up
    3
    ·
    1 year ago
    #!/bin/sh
    # Select a file with fzf from a database sorted by frecency and open it using
    # xdg-open. frece can be found at https://github.com/YodaEmbedding/frece
    
    DB_FILE=${FRECE_FILES_DB:-$HOME/.cache/frecent-files.csv}
    item=$(frece print "$DB_FILE" | fzf --tiebreak=index --scheme=path)
    
    [ -z "$item" ] && exit 1
    frece increment "$DB_FILE" "$item"
    
    xdg-open "$item"
    
    #!/bin/sh
    # Update frece database
    
    DB_FILE=${FRECE_FILES_DB:-$HOME/.cache/frecent-files.csv}
    tmp_file=$(mktemp)
    fd -H . ~ > "$tmp_file"  # use ~/.fdignore file to exclude certain dirs
    frece update "$DB_FILE" "$tmp_file" --purge-old
    rm "$tmp_file"