Delete Files with same Prefix String using Java
No, you can’t. Java is rather low-level language — comparing with shell-script — so things like this must be done more explicetly. You should search for files with required mask with folder.listFiles(FilenameFilter), and iterate through returned array deleting each entry. Like this: final File folder = … final File[] files = folder.listFiles( new FilenameFilter() { …