![]() You can use basic shell wildcard characters to broaden your search. home/tux/Documents/examples/Foo Wildcards You can broaden your search by making it case-insensitive with the -iname option: $ find ~ -iname "foo" Here's a literal search for a file with the name "foo": $ find ~ -name "foo" By default, your search string is treated literally: The find command searches for a filename that is exactly the string you enter between quotes unless you use regular expression syntax.Īssume your Documents directory contains four files: Foo, foo, foobar.txt, and foo.xml. The find command requires the path to the directory you want to search in, options to specify what attribute you're searching (for instance, - name for a case-sensitive file name), and then the search string. You can locate a file by its filename by providing the full file name or parts of the file name using regular expressions. ![]() Most commands demonstrated in this article work with other implementations of find, but should you try a command on a platform other than Linux and get unexpected results, try downloading and installing the GNU version. ![]() This article uses GNU find from the findutils package because it's readily available and pretty popular. The GNU find command, for instance, has features that the BSD or Busybox or Solaris find command might not have or does have but implements differently. However, not all find commands are exactly alike. Simply put, you already have find installed as long as you're running Linux, BSD, or macOS. The find command is defined by the POSIX specification, which creates the open standard by which POSIX systems (including Linux, BSD, and macOS) are measured.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |