blog.up-link.ro
29Apr/100

UNIX-like Tips and Tricks: find command

The find program is a search utility on Unix-like operating systems. It searches through one or more directory trees of a filesystem, locating files based on some user-specified criteria. By default, find command returns all files below the current working directory. Further, find command allows the user to specify an action to be taken on each matched file. In this article I'll show you some tips for using the find command.

To begin, let's look at the basic structure of the find command:

find start_directory  test  options  criteria_to_match  action_to_perform

Example:

In the following command, find will search for any file with the "php" extension in the current directory:

# find . -name "*.php" -print

Print This Post Print This Post