Skip to content

apathor/aged

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

# NAME
aged - Find files sorted by timestamp metadata.

# SYNOPSIS
This script is composed of two functions 'aged' and 'ti'.

aged [OPTIONS] [TARGET ...]
List files and directories sorted by file system timestamp metadata.

OPTIONS:
 -a -c -m    : Sort by time last of access, change, or modification.
 -d          : Limit results to directories.
 -f          : Limit results to files.
 -l          : Include columns for date and time.
 -n NUMBER   : List only the first NUMBER lines.
 -r          : Reverse sort order, newest files first.
 -p GLOB     : Print only files matching GLOB.
 -y INTERVAL : Show files younger than INTERVAL.
 -z INTERVAL : Show files older than than INTERVAL.

EXAMPLES:
$ aged -n1; aged -r -n1
  Show the least and most recently accessed file here.
$ aged -m -l -r -n10 ~/foo
  Show the path and timestamp of the ten most recently modified files "~/foo".
$ aged -m -z 2d -y 3w
  Show files modified more than two days but less than three weeks ago.
$ feh -Z -f <(aged -a -n6 -p '*.jpg' ~/img/)
  View the six least recently accessed JPEGs in the given directory.
$ mpv $(aged -m -p '*.ogg' -n1 ~/videos/)
  Play the oldest OGG video in the given directory.
$ aged -m -y 30d ./quux.conf || echo "not recently"
  Check if a file has been modified within 30 days.

ti [OPTIONS] INTERVAL
Parse and render temporal shorthand.

UNITS:                  | SCALES:
 s : second  d : day    |  D : 10e1  M : 10e6
 m : minute  w : week   |  H : 10e2  G : 10e9
 h : hour    y : year   |  K : 10e3  T : 10e12

MODES
 -n : numeric   : output integer number of seconds in INTERVAL
 -s : shorthand : output string shorthand of INTERVAL
 -a : after     : output date plus INTERVAL
 -b : before    : output date minus INTERVAL

OPTIONS
 -d TIME   : calculate dates relative to TIME
 -f FORMAT : render dates with printf using FORMAT

SAMPLE
 1d        : 86400 | 1Ms    : 1000000
 43m20s    : 2600  | 3Kh    : 259200000
 18h12m16s : 65536 | 2Gy    : 63115200000000000

# AUTHOR
Mike Lalumiere 2018

# License
GPLv3 (see LICENSE)

About

Find files sorted by timestamp metadata.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages