Skip to main content

Easy symlinks to the n latest files in a directory.

This is an tool that maintains symlinks to the n most recently modified files in a given directory.


Installation

pip install nlatest-files

Usage

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

Examples

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

Future Plans

  • [ ] file extension specifier

  • [ ] multiple source directories

  • [ ] recursive search

Metadata

Release files for nlatest-files 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nlatest-files 1.0.2
File Size Uploaded
nlatest-files-1.0.2.tar.gz 5.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nlatest-files 1.0.2
File Interpreter ABI Platform
nlatest_files-1.0.2-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 12.7 kB

Release files / nlatest-files-1.0.2.tar.gz

Download URL nlatest-files-1.0.2.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
12d3e7d238ad23009b424ebbc0292c732509ab24924e820ad6c271ab6a7ba83e
BLAKE2b-256 checksum
How to use checksums
0e31bd131b9b819d00ca4dd4140b15d62b55dbf81176695a9d61d1890bb5e87d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / nlatest_files-1.0.2-py2.py3-none-any.whl

Download URL nlatest_files-1.0.2-py2.py3-none-any.whl
Size 7.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
8d15fa6bc94d733b413919dfd464bc696f4f789d649364b2f6db72ad029f8407
BLAKE2b-256 checksum
How to use checksums
4e931cc9736b125e74ca819ef253a54c5ec316c50266c06dcc4ca44c9a14dd00
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page