Skip to main content

Scripts for managing media

Project description

search-fs

A simple python utility that indexes directory and file names in a sqlite database to allow for fast searching.

Definitely check out locate before considering this tool.

Installation

pip install search-fs

Usage

create-search-fs --help
search-fs --help

Create the database

create-search-fs dir1/ dir2/

Search

Search anywhere for JPG files

search-fs --name '*.jpg'

Search just one directory tree for JPG files

search-fs --name '*.jpg' dir1/

Search just one directory and not any of the sub directories for JPG files

search-fs --name '*.jpg' dir1/ --strict-dir

Search for directories

search-fs --name 'Directory*' --type d

Search for files by size

search-fs --size '500M' #Files larger than 500MB
search-fs --size='-10M' #Files smaller than 10MB, Note: make sure you use use '--size=' for less than

Search by regular expression

search-fs --name '*.jpg' --format=size,name

Format the output

search-fs --regex '\w+\d\d?\.jpg'

Cron

You can setup a cronjob to run create-search-fs so that the index is up to date.

Create dirs.txt which contains the directories to index

#Lines starting with # are ignored
/path/dir1
/other/dir2

Add line with crontab -e to update the index every hour

0 * * * * /usr/local/bin/create-search-fs --dirs /path/to/dirs.txt

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

search-fs-0.0.6.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

search_fs-0.0.6-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file search-fs-0.0.6.tar.gz.

File metadata

  • Download URL: search-fs-0.0.6.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for search-fs-0.0.6.tar.gz
Algorithm Hash digest
SHA256 e7710be0d0d4ea3c87c1b3866d52d8bcc86ebdf3ce7b262769b924b9aeda4897
MD5 24c2f8e90ce449a6b752a269306511b6
BLAKE2b-256 ede1d35035c6e87454c749fb37f746cf06c630b3ac20290cf8e25d740e6a668f

See more details on using hashes here.

File details

Details for the file search_fs-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: search_fs-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for search_fs-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 a636c395d9dd4335143152e145efa43982dd14ed76049614abbcedfc9066d6bb
MD5 5f1017483fd54b69e1689123fbffcaf1
BLAKE2b-256 613c9f4adf4df820211997a29468151777e92ae0b482937d5170f8d660432aee

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page