Skip to content

Commit

Permalink
Merge branch 'smmoosavi-patch-1'
Browse files Browse the repository at this point in the history
  • Loading branch information
srsudar committed Apr 27, 2015
2 parents d05633a + 330c88a commit 50c7553
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions eg/examples/find.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,25 @@ List files bigger than 50 megabytes (`-size +50M`) that are not named
find ./searchdir -size +50M ! -name unwanted.txt



# Execute Commands on Results

You can execute a command on all matched files using the `-exec` option. The
string `{}` will be replaced with the name of the matched file, and the command
must be terminated with an escaped semicolon (`\;`).


## Delete

Find all files (`-type f`) ending with a tilde (`-name '*~'`) and remove them
(`-exec rm -f {} \;`):

find ./searchdir -type f -name '*~' -exec rm {} \;


## Change Permissions

Make all files (`-type f`) ending in .php (`-name '*.php'`) executable by
owner, group, and world (`-exec chmod a+x {} \;`):

find ./searchdir -type f -name '*.php' -exec chmod a+x {} \;

0 comments on commit 50c7553

Please sign in to comment.