Hy, suppose you got many files in a folder and you want first to sort it in alphabetic order and then delete all files until a specific file (not including it).
So im searching for a function/command/script/whatever which takes one string as imput and the deletes all files until this file.
I thought of a simple bash-script:
for i in *; do
if [ "$i" == "input" ]; then
break;
fi
rm "$i"
done
but this is a quite long solution, and it doesnt work as wanted because the sorting is not specified. Isn't there a shorter one?
Thanks