Difference between revisions 508001 and 508002 on knwiki{{other uses}} {{unreferenced|date=September 2013}} {{lowercase|title=find}} In [[Unix-like]] and some other [[operating system]]s, <code>'''find'''</code> is a [[command-line utility]] that [[Search engine (computing)|searches]] through one or more [[directory tree]]s of a [[file system]], locates [[Computer file|file]]s based on some [[user (computing)|user]]-specified criteria and applies a user-specified action on each matched file. The possible search criteria(contracted; show full) Note that the command itself should *not* be quoted; otherwise you get error messages like find: echo "mv ./3bfn rel071204": No such file or directory which means that <code>find</code> is trying to run a file called 'echo "mv ./3bfn rel071204"' and failing. If running under Windows, don't include the backslash before the semicolon: find . -exec grep blah {} ;⏎ ⏎ If you will be executing over many results, it is more efficient to pipe the results to the [[xargs]] command instead. xargs is a more modern implementation, and handles long lists in a more intelligent way. The print0 option can be used with this. The following command will ensure that filenames with whitespaces are passed to the executed COMMAND without being split up by the shell. It looks complicated at first glance, but is widely used. find . -print0 | xargs -0 COMMAND (contracted; show full)*{{man|1|find||search for files in a directory hierarchy}} *[http://www.gnu.org/software/findutils/manual/html_mono/find.html Official webpage for GNU find] {{Unix commands}} [[Category:Searching]] [[Category:Standard Unix programs]] [[Category:Unix SUS2008 utilities]] All content in the above text box is licensed under the Creative Commons Attribution-ShareAlike license Version 4 and was originally sourced from https://kn.wikipedia.org/w/index.php?diff=prev&oldid=508002.
![]() ![]() This site is not affiliated with or endorsed in any way by the Wikimedia Foundation or any of its affiliates. In fact, we fucking despise them.
|