How to find and delete files in Linux

Using the find command in Linux you can search for file names matching a specific pattern and optional delete them.

Find all files ending in pdf.1 at and below the current directory

find . -name "*.pdf.1" -type f

Delete all files ending in pdf.1 at and below the current directory

find . -name "*.pdf.1" -type f -delete

Justin Kelly

Justin Kelly

Data Engineeer, Business Analytics, Web Developer, Library Technology specialising in PHP and Tableau

Based in Melbourne, Australia

Feel free to contact me justin@kelly.org.au or _justin_kelly