Finding files for which a command failsFinding a substring in files across subdirectories with a single built-in command?Find a file in lots of zip files (like find command for directories)Finding all “Non-Binary” filesHow to count recursively for the number of files in several directories?Which command to use to find all files/folders with non-default permissions?List files recursively in Linux CLI with path relative to the current directory, max 250 charFind command fails to copy few filesFinding files that have been modified using a script?Finding files and directories with different umaskAggregate status code from sub-scripts in a script
Random Forest different results for same observation
How would 10 generations of living underground change the human body?
Check if a string is entirely made of the same substring
How can I practically buy stocks?
Why was the Spitfire's elliptical wing almost uncopied by other aircraft of World War 2?
As an international instructor, should I openly talk about my accent?
What's the polite way to say "I need to urinate"?
Coordinate my way to the name of the (video) game
How does Captain America channel this power?
Multiple options vs single option UI
I preordered a game on my Xbox while on the home screen of my friend's account. Which of us owns the game?
'It addicted me, with one taste.' Can 'addict' be used transitively?
Extension of 2-adic valuation to the real numbers
What happens in the secondary winding if there's no spark plug connected?
How could Tony Stark make this in Endgame?
How did Captain America manage to do this?
Why boldmath fails in a tikz node?
Why does Mind Blank stop the Feeblemind spell?
How to denote matrix elements succinctly?
Was there a shared-world project before "Thieves World"?
Contradiction proof for inequality of P and NP?
Is there really no use for MD5 anymore?
Why does nature favour the Laplacian?
'regex' and 'name' directives in find
Finding files for which a command fails
Finding a substring in files across subdirectories with a single built-in command?Find a file in lots of zip files (like find command for directories)Finding all “Non-Binary” filesHow to count recursively for the number of files in several directories?Which command to use to find all files/folders with non-default permissions?List files recursively in Linux CLI with path relative to the current directory, max 250 charFind command fails to copy few filesFinding files that have been modified using a script?Finding files and directories with different umaskAggregate status code from sub-scripts in a script
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I would like to recursively find all the files for which a script which accepts a file as an argument returns a non-zero value. Any idea how to do this using 'find' or a similar tool?
files scripting find exit-status
add a comment |
I would like to recursively find all the files for which a script which accepts a file as an argument returns a non-zero value. Any idea how to do this using 'find' or a similar tool?
files scripting find exit-status
add a comment |
I would like to recursively find all the files for which a script which accepts a file as an argument returns a non-zero value. Any idea how to do this using 'find' or a similar tool?
files scripting find exit-status
I would like to recursively find all the files for which a script which accepts a file as an argument returns a non-zero value. Any idea how to do this using 'find' or a similar tool?
files scripting find exit-status
files scripting find exit-status
edited Apr 14 at 13:21
Jeff Schaller♦
45.4k1164147
45.4k1164147
asked Apr 8 at 5:05
mitanyenmitanyen
13313
13313
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
find
’s -exec
action can be used for this:
find . ! -exec yourscript ; -print
will print the names of all files for which yourscript
fails.
-exec
can be used in this way to turn appropriate external commands into find
tests.
8
Equivalently, using-o
(or):find . -exec yourscript ; -o -print
.
– John Kugelman
Apr 8 at 19:07
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f511154%2ffinding-files-for-which-a-command-fails%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
find
’s -exec
action can be used for this:
find . ! -exec yourscript ; -print
will print the names of all files for which yourscript
fails.
-exec
can be used in this way to turn appropriate external commands into find
tests.
8
Equivalently, using-o
(or):find . -exec yourscript ; -o -print
.
– John Kugelman
Apr 8 at 19:07
add a comment |
find
’s -exec
action can be used for this:
find . ! -exec yourscript ; -print
will print the names of all files for which yourscript
fails.
-exec
can be used in this way to turn appropriate external commands into find
tests.
8
Equivalently, using-o
(or):find . -exec yourscript ; -o -print
.
– John Kugelman
Apr 8 at 19:07
add a comment |
find
’s -exec
action can be used for this:
find . ! -exec yourscript ; -print
will print the names of all files for which yourscript
fails.
-exec
can be used in this way to turn appropriate external commands into find
tests.
find
’s -exec
action can be used for this:
find . ! -exec yourscript ; -print
will print the names of all files for which yourscript
fails.
-exec
can be used in this way to turn appropriate external commands into find
tests.
edited Apr 8 at 5:56
answered Apr 8 at 5:20
Stephen KittStephen Kitt
183k26420500
183k26420500
8
Equivalently, using-o
(or):find . -exec yourscript ; -o -print
.
– John Kugelman
Apr 8 at 19:07
add a comment |
8
Equivalently, using-o
(or):find . -exec yourscript ; -o -print
.
– John Kugelman
Apr 8 at 19:07
8
8
Equivalently, using
-o
(or): find . -exec yourscript ; -o -print
.– John Kugelman
Apr 8 at 19:07
Equivalently, using
-o
(or): find . -exec yourscript ; -o -print
.– John Kugelman
Apr 8 at 19:07
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f511154%2ffinding-files-for-which-a-command-fails%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown