Question: I'd like to remove `*.(deb|rpm)` files from my `Downloads` folder on my Ubuntu machine every hour.

I have this on my crontab

```
* */1 * * * cd /home/alexalannunes/Downloads && ls *.deb > log.txt && rm  *.deb

```

'Cause I want a log of which files have been removed.

But this line removes only `*.deb`. I want to remove files with `(.deb|.rmp|.other_file)`

It's possible?

I tried to search in google but I didn't find anything

Thanks!

Answer: 
You can specify as many extensions as you want, just list them separately. E.g.:

```
* */1 * * * cd /home/alexalannunes/Downloads && ls *.deb *.rpm > log.txt && rm  *.deb *.rpm

```
If the shell supports in which the crontab runs suppports brace expansions, you can give multiple extensions by using brace expansion:

```
*.{rpm,deb,other_file}

```

Otherwise just chain multiple extensions.

```
*.rpm *.deb

```

Also, you don't need a separate `ls`, `rm` has verbose output with `-v` and you should add `-f` to ignore nonexistent files and arguments and never prompt.

```
* */1 * * * rm -fv /home/alexalannunes/Downloads/*.{deb,rpm} > log.txt

```

or

```
* */1 * * * rm -fv /home/alexalannunes/Downloads/*.deb /home/alexalannunes/Downloads/*.rpm > log.txt

```