DEV Community


Discussion on: Deleting Files and Directories in Linux System

yashsugandh profile image
yash sugandh Author

Hey Sjoer van der Ploeg,

Let's take an example

  • remove all the files that start with "file" and has exactly one character after that 1, 2 or 3


In the above example, we used wildcard [] and created command rm file[123] where

rm represents remove command
file represents the text "file" in the filename
[123] represents exactly one character out of values 1, 2 or 3

If you still have any queries related to wildcards please look at the previous post on Wildcards(*,?,[],[[:class:]]) for better understanding.