跳转到主要内容

媒体管理脚本

项目描述

search-fs

一个简单的Python实用工具,用于在sqlite数据库中索引目录和文件名,以实现快速搜索。

在考虑此工具之前,请务必查看locate

安装

pip install search-fs

使用

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

创建数据库

create-search-fs dir1/ dir2/

搜索

在任何地方搜索JPG文件

search-fs --name '*.jpg'

仅在一个目录树中搜索JPG文件

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

仅在一个目录中搜索JPG文件,不包括任何子目录

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

搜索目录

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

按大小搜索文件

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-fs --regex '\w+\d\d?\.jpg'

格式化输出

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

计划任务

您可以为运行create-search-fs设置计划任务,以确保索引是最新的。

创建包含要索引的目录的dirs.txt

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

使用crontab -e添加行以每小时更新索引

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

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。

源分发

search-fs-0.0.6.post1.tar.gz (8.9 kB 查看哈希值)

上传时间

构建分发

search_fs-0.0.6.post1-py3-none-any.whl (10.8 kB 查看哈希)

上传时间: Python 3

支持者

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面