www.delorie.com/gnu/docs/findutils/find_46.html   search  
 
Buy GNU books!


Finding Files

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.3 Querying

To ask the user whether to execute a command on a single file, you can use the find primary `-ok' instead of `-exec':

Action: -ok command ;
Like `-exec' (see section 3.3.1 Single File), but ask the user first (on the standard input); if the response does not start with `y' or `Y', do not run the command, and return false.

When processing multiple files with a single command, to query the user you give xargs the following option. When using this option, you might find it useful to control the number of files processed per invocation of the command (see section 3.3.2.3 Limiting Command Size).

--interactive
-p
Prompt the user about whether to run each command line and read a line from the terminal. Only run the command line if the response starts with `y' or `Y'. Implies `-t'.


  webmaster   donations   bookstore     delorie software   privacy  
  Copyright © 2003   by The Free Software Foundation     Updated Jun 2003  

Please take a moment to fill out this visitor survey
You can help support this site by visiting the advertisers that sponsor it! (only once each, though)