Skip to content

Instantly share code, notes, and snippets.

@403-html
Last active December 4, 2025 20:56
Show Gist options
  • Select an option

  • Save 403-html/65d6cfec61e8ed4458dc4825eedf942d to your computer and use it in GitHub Desktop.

Select an option

Save 403-html/65d6cfec61e8ed4458dc4825eedf942d to your computer and use it in GitHub Desktop.
Selecting and deleting files in bulk in current directory
# Selecting in nicer form with fzf
fdel() {
find . -maxdepth 1 -type f -print0 \
| sort -z \
| fzf --read0 --multi \
--preview 'ls -lh -- {}' \
--bind 'enter:execute(rm -- {+})+abort'
}
# Thanks to this I can just open current directory
# run `fdel`
# select files I don't want with "TAB"
# and when all selected, I click "RETURN" and files are deleted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment