ffiler
File Filer; sorts files into structured directory tree. Tree can be structured based on various designs such as date (file modification time), file hash, file prefix etc
Usage
Filing Method
There are various filing tree structures available:
- Modified Timestamp
- MD5 hash of file name
- MD5 hash of file contents (slower)
- Leading characters of file name
- MIME type of file
Modified Timestamp
An example tree (directories only) filing to a depth of 2 (YYYY/Month/):
βββ 2014
β βββ 01-Jan
β βββ 02-Feb
β βββ ...
β βββ 11-Nov
β βββ 12-Dec
βββ 2015
βββ 01-Jan
βββ 02-Feb
βββ 03-Mar
βββ 04-Apr
βββ 05-May
By MD5 Hash
An example tree (directories only) filing to a depth of 2 characters:
βββ 2
β βββ 2
β βββ b
βββ a
β βββ 1
β βββ e
βββ e
βββ 1
βββ 7
By Filename
Similar to filing by hash, but don't bother to hash anything first (just take the first X characters of the filename).
An example tree (including files) filing to a depth of 2 characters:
βββ e
β βββ l
β β βββ elephant
β βββ x
β βββ example
βββ f
β βββ f
β β βββ ffiler
β βββ i
β βββ file
βββ t
βββ e
βββ test
Mime type
An example tree (including files):
βββ application
β βββ postscript
β βββ mylogo.eps
βββ image
βββ jpeg
β βββ mylogo.jpg
β βββ yourlogo.jpg
β βββ herlogo.jpeg
βββ png
βββ hislogo.png
Filing Depth
Most of the filing methods require a depth for the resulting tree structure. Valid depths depend on the filing method.
For string-based methods (MD5 hashes or filenames) the depth is the number of characters (positive integer) to build the tree with.
Example: ffiler -ss -d2
(Sort to the second character as above)
For timestamp-based methods (modified time) the depth is the timestamp granularity:
y
= Year (eg2010/
)m
= Month (eg2010/01-Jan/
)d
= Day (eg2010/01-Jan/15/
)H
= Hour (eg2010/01-Jan/15/18/
)M
= Minute (eg2010/01-Jan/15/18/20/
)S
= Second (eg2010/01-Jan/15/18/20/34/
)
Example: ffiler -sm -dm
(Sort to the "month" level)
Action
ffiler can move (default), copy, symlink or hardlink files into the destination tree. The flags for these are:
-M Move
-C Copy
-L Symbolic Link
-H Hard Link
Installation
Arch Linux
PKGBUILD is in the AUR: https://aur.archlinux.org/packages/ffiler-git/