I have an alias
rm='rm -irv' and I want to delete a bunch of files and/or directories but I only want 1 confirmation message like
rm: descend into directory 'myfolder'?
I don't mind confirming for each directory but not for each file within each directory. The zsh feature for
rm * or
rm something/* works well but sometimes I am just deleting files
rm *.txt or a single file
rm document.txt but I would still like at least 1 confirmation.
This solution comes very close to what I'm looking for but does not work in every scenario. So let's say the directory "myfolder" contains 100 files then I would like something that looks like this:
~ > ls -F myfolder/ empty.txt file.txt main.c ~ > rm * zsh: sure you want to delete all 4 files in /home/user [yn]? n ~ > rm myfolder rm: descend into directory 'myfolder'? y removed 'file1.txt' removed 'file2.txt' ... removed 'file100.txt' removed directory 'myfolder' ~ > rm main.c rm: remove regular file 'main.c'? y removed 'main.c' ~> rm *.txt rm: remove all '*.txt' files? y removed 'empty.txt' removed 'file.txt'