User Tools

Site Tools


eric:computer:bash:commands:find.command

find command

The find command will scan the disk directories for a match. If you want a faster method, try the locate command, if it is installed. Locate creates a database (updatedb command) and searches the database which is faster than scanning through all the disk directories, but it may be out of date depending on when the updatedb command was last run.

Example

find /mnt/ -type f -iname *Feathers* -print

/mnt/ is the local source directory
-type f specifies looking for files only
-name *Feathers* is the partial name we are searching for (case sensitive)
-iname *feathers* is the partial name we are searching for (case insensitive)
-print will display only results and errors

find / -type f -iname koha-run-backups.sh -print Searches for a file starting at the root directory.
find /root -type d -iname neon.ericjulie.com -print Searches for a directory in the /root directory.

man find for more information.

eric/computer/bash/commands/find.command.txt · Last modified: by admin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki