AWS CloudEC2Linux

Steps to install Locate command to find files on Amazon Linux

In this blog, we will show you the steps to install locate command to find files on Amazon Linux or CentOS. Searching files in the filesystem, mostly we use “find command”, there is one more command in Linux which we can use for finding files i.e., “locate command”

Steps to install Locate command to find files on Amazon Linux

Find command:

  • Searches a directory structure for requested files
  • print is the default action and displays matches
  • ls displays full details on matches
  • exec allows a command to be run against each
  • ok can be sued when a confirmation prompt is desired

 Locate command

  • High-speed and low-impact searching because it doesn’t actually search the filesystem it searches the database that was built
  • Searches DB index instead of actual filesystem
  • Index updated each night by default and you can manually update by command “updatedb”
  • Locate won’t know about recently added/deleted files until databases are rebuilt

Verify locate command installed or not:

Steps to install Locate command to find files on Amazon Linux or CentOS using YUM:

So, from the above output locate command is not installed.

Steps to install Locate command on Debian/Ubuntu:

Default database storage location mlocate.db, updatdb is the command to rebuild the database which is recently added/deleted files.

How to check locate command installed on Amazon Linux

As per output locate is installed.

Steps to remove locate command from Amazon Linux server:

These are the steps to install Locate command to find files on Amazon Linux or CentOS

Related Articles

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Close

Adblock Detected

Please consider supporting us by disabling your ad blocker