指向目录中n个最新文件的简单符号链接

nlatest-files的Python项目详细描述


指向目录中n个最新文件的简单符号链接。

这是一个维护到最近修改的n的符号链接的工具 给定目录中的文件。


安装

pip install nlatest-files

用法

usage: nlf [-h] [-c FILE] [--save] -d DIR [-n COUNT] [-u] [-s DIR] [-f FORMAT]
           [-q]

Args that start with '--' (eg. --save) can also be set in a config file
(/home/user/.config/nlatest-files.conf or specified via -c). Config file syntax
allows: key=value, flag=true, stuff=[a,b,c] (for details, see syntax at
https://goo.gl/R74nmi). If an arg is specified in more than one place, then
commandline values override config file values which override defaults.

optional arguments:
  -h, --help            show this help message and exit
  -c FILE, --config FILE
                        config file location, defaults to
                        $XDG_CONFIG_HOME/nlatest-files.conf
  --save                if specified, saves the current configuration to the
                        config file
  -d DIR, --dir DIR     the source directory
  -n COUNT, --count COUNT
                        the latest n files to list, defaults to 1
  -u, --update-symlinks
                        create symlinks to the latest n files
  -s DIR, --symlink-dir DIR
                        the directory to create symlinks in, defaults to the
                        source directory
  -f FORMAT, --symlink-format FORMAT
                        the format string for symlinks, where {n} is the order
                        index, defaults to 'latest-{n}'. {n} must be included,
                        unless n = 1
  -q, --quiet           if specified, no status messages will be printed to
                        stderr

示例

nlf -d ~/invoices -n 5
    Prints the latest 5 files in ~/invoices

nlf -d ~/invoices -n 5 --save
    Saves the given parameters to the default config file

nlf -d ~/invoices -n 5 -c ~/dotfiles/myconfig.conf --save
    Saves the given parameters to the specified config file

nlf
    Prints the latest 5 again, using from the config file

nlf -u -s $HOME/screenshots -f "screeny-{n}" -n 3
    Creates symlinks to the top 3 latest screenshots in ~/screenshots

scrot -e 'mv -u $f ~/screenshots/ && nlf -u -d ~/screenshots -n 1 -f "latest"'
    Takes a screenshot with scrot, moves it to ~/screenshots, then
    adds a `symlink ~/screenshots/latest` pointing to it

未来计划

  • []文件扩展名说明符
  • []多个源目录
  • []递归搜索

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
junit有没有办法在Java中重新初始化静态类?   在浏览器中点击应用程序时java Play框架挂起   文件Java错误中的NullPointerException   使用Java中的SNMP查找网络中计算机的登录名   java包装服务器引导程序已弃用,有什么替代方案?   当客户在等待理发时,java信号量值是否存在问题?   java如何使用JavaMail仅下载特定类型的附件   如何在java中将十进制转换为十六进制   java Slick2D粒子系统不会生成粒子   java检测更改事件来自何处   将Java集合类型参数类设置为数组   java如何从eclipse导出为可运行JAR文件?   java EntityManager对象未注入Glassfish和Spring   swing从actionPerformed和actionListener Java返回字符串   java在给定另一个等价键对象的情况下获取映射项的当前键   无论输入如何,java网络都会产生相同的输出