Wildcards can be pretty helpful when doing some basic tasks either from the Windows GUI or the beloved command prompt.
Let’s take a look at the frequently used wildcard * for doing some simple but effective stuff.
For understanding purposes,I have created a folder called textfiles in C: with the following files :
apples.txt,oranges.txt,bananas.txt,applejuice.txt,orangejuice.txt.bananajuice.txt
Let’s say we want to see only files that start with the word “apple” from this directory.To do this,we just use the * card like this :
dir apple*.txt
This will display the files which start with the word apple.
Let’s say we need to display files whose names contain the following words – “juice” at the end.
This is done by the simple command : dir *juice.txt
The placement of * at the beginning,the middle or the end means that the specified part where it is inputed can be anything as in all.
Example : this command dir *an*.txt will list those files that have “an” word in it regardless of what the starting and ending characters are.
What if you need to list all files regardless of what they are named?
It can be done simply by typing dir or dir *.*
Feel free to do some not so usual stuff like sorting filenames and redirecting their output to a file on a regular basis or so on.
Definitely a weekend fun project 😉
>thanks for such nice post
regards
Anuj
http://www.winservers.co.in
>@Anuj Sharma – Glad you found it useful.
>It is very informative and helpful article. Thanks for the sharing.
>@New Cars – Thanks for the feedback.Appreciate it.