Linux or UNIX – Find and remove file command – bash

28. Juli 2011 at 14:23

Find and remove file (about name)

find . -name "FILE-TO-FIND"-exec rm -rf {} \;

Find and remove file (about file type)

find . -type f -name "FILE-TO-FIND" -exec rm -f {} \;

Find all *.bak files in current directory and removes them with confirmation from user:

$ find . -type f -name "*.bak" -exec rm -i {} \;

Find all core files and remove them:

find / -name core -exec rm -f {} \;
Daniel Briegert

Daniel Briegert

xing: https://www.xing.com/profile/Daniel_Briegert

More Posts - Website

Follow Me:
TwitterFacebook

Tags: