I thought this would be an easy subject to find help on, but my searches have turned up little.
I want to get a listing of files in a directory using a wildcard.
For example I only want to list the files that have their name prefixed with "BigE_". My intent is to delete them.
Using a path with a wildcard for the partial filename such as "/usr/local/home/BigE_*" does not work with the unlink() command, nor does it seem to work with dir directory class when generating a listing. I get an error saying no such file or directory exists. If I leave out the wild card and just have "/usr/local/home/" I get the all files in the directory. I know I could list the entire directory and check each file for the designated prefix. That just seems silly.
I admit to coming from a DOS background so perhaps wildcard searches work differently in Linux.
Can a listing be done with a wildcard?
Thanks,
E