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 {} \;
GD Star Rating
loading...
GD Star Rating
loading...
Linux or UNIX - Find and remove file command - bash, 10.0 out of 10 based on 1 rating
Tags: