Locate files on linux, FreeBSD and UNIX system

Locate files on linux, FreeBSD and UNIX system

To locate files on a Linux, FreeBSD, or UNIX-like system, you can use the "find" command or the "locate" command. "find" is a command-line utility that allows you to search for files based on various criteria, and "locate" is a command-line utility that allows you to find files based on their names.

To locate files using "find", follow these steps:

  1. Open a terminal and navigate to the directory where you want to start the search.

  2. Type the following command:

find . -name 'pattern'
Source:ww‮ruttual.w‬i.com

Replace "pattern" with the name or pattern of the files you want to locate. The "." indicates the current directory, and the "-name" option specifies the pattern to search for.

  1. The "find" command will search for files that match the specified pattern and display their names and paths.

To locate files using "locate", follow these steps:

  1. Open a terminal and type the following command:
locate pattern

Replace "pattern" with the name or pattern of the files you want to locate.

  1. The "locate" command will search for files that match the specified pattern and display their names and paths.

With these steps, you should be able to locate files on a Linux, FreeBSD, or UNIX-like system using the "find" or "locate" commands. Consult the documentation of "find" and "locate" for more information on how to use these utilities.

Created Time:2017-10-30 10:17:49  Author:lautturi