lsfrom: List directory files starting from a specific name

[ bsd3, program, utility ] [ Propose Tags ] [ Report a vulnerability ]

lsfrom lists the entries of a directory starting from a particular file and then the files after it with respect to locale collation ordering. This can be useful for example for continuing a command or script in a directory after a failure.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1, 0.1.1, 0.1.1.1, 1.0
Change log ChangeLog.md
Dependencies base (<5), filepath, safe, simple-cmd (>=0.1.4), simple-cmd-args (>=0.1.2) [details]
License BSD-3-Clause
Copyright 2018,2021-2024 Jens Petersen
Author Jens Petersen <petersen@redhat.com>
Maintainer Jens Petersen <petersen@redhat.com>
Category Utility
Home page https://github.com/juhp/lsfrom
Bug tracker https://github.com/juhp/lsfrom/issues
Source repo head: git clone https://github.com/juhp/lsfrom.git
Uploaded by JensPetersen at 2024-01-07T13:07:10Z
Distributions Fedora:1.0
Executables lsfrom
Downloads 312 total (15 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2024-01-07 [all 1 reports]

Readme for lsfrom-1.0

[back to package description]

lsfrom

lsfrom lists the files and dirs in a directory starting from the given filename or the first file after that if the file does not exist, using the current locale collation order.

$ ls
A a B C
$ echo $(lsfrom a)
a B C
$ lsfrom a/
a
B
C
$ lsfrom /sy
/sys
/tmp
/usr
/var

It can be useful for continuing a script on the entries of a directory after a failure, etc:

$ myscript.sh $(lsfrom next)

or only running a command on a subrange of files in a directory.

Usage

$ lsfrom --version

1.0

$ lsfrom -h

List directories files starting from file

Usage: lsfrom [--version] [-s|--strict] [-A|--all] [-a|--after]
              [-u|--until LASTFILE] [-b|--before] STARTFILE

  lsfrom lists the files in a directory that follow from the given file

Available options:
  -h,--help                Show this help text
  --version                Show version
  -s,--strict              fail if specified file(s) do not exist
  -A,--all                 include hidden (dot) files
  -a,--after               files after STARTFILE [default: from STARTFILE]
  -u,--until LASTFILE      files until FILE
  -b,--before              files before LASTFILE (only affects --until)

Requirements

It uses ls to list files with locale sorting and requires the -A option to exclude . and .. (ie coreutils). It also uses sort when injecting missing marker files. It has been tested on Linux.

Installation

stack install lsfrom or cabal install lsfrom.

Contribute or feedback

lsfrom is distributed with BSD license and the project is hosted at https://github.com/juhp/lsfrom.