InfinityQuest - Programming Code Tutorials and Examples with Python, C++, Java, PHP, C#, JavaScript, Swift and more

Menu
  • Home
  • Sitemap

Python Programming Language Best Tutorials and Code Examples

Learn Python Right Now!
Home
Bash
Finding Existing Files and Content Fast in bash
Bash

Finding Existing Files and Content Fast in bash

InfinityCoder February 20, 2017

You’d like to be able to find files without having to wait for a long find command to complete, or you need to find a file with some specific content.

If your system has locate, slocate, Beagle, Spotlight or some other indexer, you are already set.

If not, look into them.
The location of the actual database files, what is indexed therein, and how often, may vary from system to system.
Consult your system’s manpages for details.

1
2
3
4
5
6
7
$ locate apropos
/usr/bin/apropos
/usr/share/man/de/man1/apropos.1.gz
/usr/share/man/es/man1/apropos.1.gz
/usr/share/man/it/man1/apropos.1.gz
/usr/share/man/ja/man1/apropos.1.gz
/usr/share/man/man1/apropos.1.gz

locate and slocate don’t index content though, so see Recipe 9.9, “Finding Files by Content” for that.

Beagle and Spotlight are examples of a fairly recent technology known as desktop search engines or indexers.

Google Desktop Search and Copernic Desktop Search are two examples from the Microsoft Windows world.

Desktop search tools use some kind of indexer to crawl, parse, and index the names and contents of all of the files (and usually email messages) in your personal file space; i.e., your home directory on
a Unix or Linux system.

This information is then almost instantly available to you when you look for it.

These tools are usually very configurable, graphical, operate on a per-user basis, and index the contents of your files.

slocate stores permission information (in addition to filenames and paths) so that it will not list programs to which the user does not have access.

On most Linux systems locate is a symbolic link to slocate; other systems may have separate programs, or may not have slocate at all.

Both of these are command-line tools that crawl and index the entire filesystem, more or less, but they only contain filenames and locations.

Share
Tweet
Email
Prev Article
Next Article

Related Articles

Getting bash for Linux in bash
You want to get bash for your Linux system, or …

Getting bash for Linux in bash

Sending Both Output and Error Messages to Different Files in bash
You are expecting output from a program but you don’t …

Sending Both Output and Error Messages to Different Files in bash

About The Author

InfinityCoder
InfinityCoder

Leave a Reply

Cancel reply

Recent Tutorials InfinityQuest

  • Adding New Features to bash Using Loadable Built-ins in bash
    Adding New Features to bash Using Loadable …
    June 27, 2017 0
  • Getting to the Bottom of Things in bash
    Getting to the Bottom of Things in …
    June 27, 2017 0

Recent Comments

  • fer on Turning a Dictionary into XML in Python
  • mahesh on Turning a Dictionary into XML in Python

Categories

  • Bash
  • PHP
  • Python
  • Uncategorized

InfinityQuest - Programming Code Tutorials and Examples with Python, C++, Java, PHP, C#, JavaScript, Swift and more

About Us

Start learning your desired programming language with InfinityQuest.com.

On our website you can access any tutorial that you want with video and code examples.

We are very happy and honored that InfinityQuest.com has been listed as a recommended learning website for students.

Popular Tags

binary data python CIDR convert string into datetime python create xml from dict python dictionary into xml python how to create xml with dict in Python how to write binary data in Python IP Address read binary data python tutorial string as date object python string to datetime python

Archives

  • June 2017
  • April 2017
  • February 2017
  • January 2017
  • December 2016
  • November 2016
Copyright © 2021 InfinityQuest - Programming Code Tutorials and Examples with Python, C++, Java, PHP, C#, JavaScript, Swift and more
Programming Tutorials | Sitemap