I am learning the shell commands and came across the short tags eg.[0-9],[[:digit:]] etc.. As a proof of concept i tried deleting all the files with the rm command(i know its not a good practise but i am trying to understand how things work),like this
there were two files in the directory 0.txt and 9.txt and it deleted the files 0.txt and 9.txt .I guessed that the expression [0-9] is expanded and then read as 0.txt 1.txt 2.txt .... However when you try only rm 5.txt,and the file does not exist, an error is thrown..
someone please tell me how the shorthand commands work when used with rm or ls.