
shell - Understanding the -exec option of `find` - Unix & Linux Stack ...
Sep 1, 2017 · Each -exec also acts like a "test" on the pathnames found by find, just like -type and -name does. If the command returns a zero exit status (signifying "success"), the next part of the find …
bash - find -exec with multiple commands - Stack Overflow
The first answer of Denis is the answer to resolve the trouble. But in fact it is no more a find with several commands in only one -exec like the title suggests. To answer the one -exec with several commands …
bash - 'find -exec' a shell function in Linux - Stack Overflow
Dec 1, 2010 · To provide additions and clarifications to some of the other answers, if you are using the bulk option for exec or execdir (-exec command {} +), and want to retrieve all the positional …
How do I include a pipe | in my linux find -exec command?
Feb 18, 2015 · find -name 'file_*' -follow -type f -exec zcat {} \; | agrep -dEOE 'grep' In terms of efficiency this results costs one invocation of find, numerous invocations of zcat, and one invocation of agrep. …
linux - Find and copy files - Stack Overflow
10 You need to use cp -t /home/shantanu/tosend in order to tell it that the argument is the target directory and not a source. You can then change it to -exec ... + in order to get cp to copy as many …
find's "-exec rm {} \;" vs "-delete" - Unix & Linux Stack Exchange
find /usr/local/share/ -iname "useless" -exec rm -r {} \; In brief, the -exec gives you a bit more control over the actual command that removes the found item. The advantage is that you use one tool to find …
Problem running find: missing argument to `-exec' - Unix & Linux Stack ...
Oct 31, 2023 · I'd like to find the files in the current directory that contain the text "chrome". $ find . -exec grep chrome find: missing argument to `-exec' What am I doing wrong?
Using semicolon (;) vs plus (+) with exec in find - Stack Overflow
Apr 25, 2014 · Using -exec with a semicolon (find . -exec ls '{}' \;), will execute ls file1 ls file2 ls file3 But if you use a plus sign instead (find . -exec ls '{}' \+), as many filenames as possible are passed as …
How to move or copy files listed by 'find' command in unix?
Jun 28, 2013 · I have a list of certain files that I see using the command below, but how can I copy those files listed into another folder, say ~/test? find . -mtime 1 -exec du -hc {} +
How to pipe the results of 'find' to mv in Linux - Stack Overflow
Mar 13, 2014 · Sounds like you are not on Linux after all then, as this has been supported by the GNU versions of these tools for a long time. I can't find (sic) a find which doesn't support -exec in some …