slocate command in Linux is used to find the files in your system. This is a secure version of the Linux command locate which is also used for file searching, similar to locate command it creates a database of the file locations for faster searching. But it is much more secure than locate command because it allows users to only see the files that the particular user is authorized with. So if a superuser decides to create files with permission only for the superuser then non-superusers won’t have access to those files while using slocate command. later slocate got replaced with command mlocate which has been a more sophisticated way of using it.
Syntax:
slocate [OPTION]... [FILE]....
Options of slocate command
1. NO Option: Prints files by the name.
Syntax :
slocate [FILE]
Example :
2. -0 Option: Separate the entries on output using the ASCII NULL character instead of writing each entry on a separate line.
Syntax :
slocate -0 [FILE]
Example :
3. -i Option: Ignore case distinctions when matching patterns.
Syntax :
slocate -i [FILE]
Example :
4. -c Option: Instead of writing file names on standard output, write the number of matching entries only.
Syntax :
slocate -c [FILE]
Example :
5. -l Option: Exit successfully after finding LIMIT entries.
Syntax :
slocate -l [NUMBER] [FILE]
Example :