Separate Output Entries Without New Line Using locate Command
locate -i -0 *sample.txt*
Default separator for locate command is the newline (\\n) character. But if someone wants to use a different separator like the ASCII NULL, then he/she can do so using the -0 command line option.
locate command in Linux with Examples
locate command in Linux is used to find the files by name. There are two most widely used file-searching utilities accessible to users called to find and locate. The locate utility works better and faster than the find command counterpart because instead of searching the file system when a file search is initiated, it would look through a database. This database contains bits and parts of files and their corresponding paths on your system. By default, locate command does not check whether the files found in the database still exist and it never reports files created after the most recent update of the relevant database.
Table of Content
- Syntax of `locate` command in Linux
- Options Available in `locate` command in Linux
- Search a File with Specific Name Using locate Command
- Limit Search Queries to a Specific Numbe Using locate Command
- Display The Number of Matching Entries Using locate Command
- Ignore Case Sensitive Locate Outputs Using locate Command
- Separate Output Entries Without New Line Using locate Command