How to use the Linux slocate command

Source: Internet
Author: User

Slocate itself has a database that stores information about files and directories in the system.

Syntax

Slocate [-u] [-- help] [-- version] [-d <Directory>] [searched file]

Parameters:

  • -D <Directory> or -- database = <Directory> specifies the directory where the database is located.

  • -U updates the slocate database.

  • -- Help: displays help.

  • -- Version: displays the version information.

Instance

Run the command "slocate" to display the file path information with the keyword "fdisk" in the file name. Enter the following command:

$ Slocate fdisk # display the path information of the file with the fdisk keyword in the file name

After the preceding command is executed, the command output is as follows:

$ Slocate fdisk # display the path information of the file containing the fdisk keyword in the file name/root/cfdisk # List of searched file paths/root/fdisk/root/sfdisk/usr/include/grub /ieee1275/ofdisk. h/usr/share/doc/util-Linux/README. cfdisk/usr/share/doc/util-Linux/README.fdisk.gz/usr/share/doc/util-Linux/examples/sfdisk.examples.gz

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.