Last active
December 4, 2025 20:56
-
-
Save 403-html/65d6cfec61e8ed4458dc4825eedf942d to your computer and use it in GitHub Desktop.
Selecting and deleting files in bulk in current directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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