[bash] FileBot Command-Line Examples

Running FileBot from the console, Groovy / FileBot scripting, shell scripts, etc
User avatar
rednoah
The Source
Posts: 11290
Location: Taipei
Contact:

[bash] FileBot Command-Line Examples

Postby rednoah » 26 Feb 2017, 19:36

Call filebot with many files:

Code: Select all

find . -type f -iname '*.mp4' -exec filebot -script fn:sysenv {} +


Call filebot for each folder:

Code: Select all

find . -type d -exec filebot -rename -non-strict {} ';'


Rename files and episodes in linear order:

Code: Select all

filebot -list --q Firefly --filter regular --format {plex.name} -rename *.mp4


Create empty test files:

Code: Select all

filebot -list --q Alias --filter regular --format {plex.name}.mp4 --log OFF | tr '\n' '\0' | xargs -0 touch


Set the Last Modified Date for each media file to the episode airdate or movie release date:

Code: Select all

filebot -mediainfo -r . --format "touch -t {d.format 'YYYYMMdd0000'} {quote f}" | sh -x


Create new structure with Jackie Chan movies:

Code: Select all

filebot -rename -r . --db xattr --action hardlink --output 'Jackie Chan' --filter 'actors =~ /Jackie Chan/'


Create new structure by genre:

Code: Select all

filebot -rename -r . --db xattr --action hardlink --output 'By Genre' --filter genre --format {genre}/{plex.name}


Create new structure by director:

Code: Select all

filebot -rename -r . --db xattr --action hardlink --output 'By Director' --filter director --format {director}/{plex.name}


Move old movies:

Code: Select all

filebot -rename -r . --db xattr --output 'Old Movies' --filter 'movie && y < 1970'


Copy recently aired episodes:

Code: Select all

filebot -rename -r . --db xattr --action copy --output /Volumes/USB --filter 'episode && age < 30'


List Science Fiction movies:

Code: Select all

filebot -mediainfo -r . --filter 'genres =~ /Science Fiction/' --format {f}


Delete non-English subtitles:

Code: Select all

filebot -mediainfo -r . --filter 'f.subtitle && !(lang =~ /eng/)' --format {f} | xargs -I % rm -v %


Rename and organize photos by date taken:

Code: Select all

filebot -rename *.jpg --db xattr -non-strict --filter exif --format "{dt.format 'yyyy/yyyy-MM-dd HH∶mm∶ss'}"


Organize photos by year:

Code: Select all

filebot -rename *.jpg --db xattr -non-strict --filter exif --format {y}/{fn}


Organize photos by camera:

Code: Select all

filebot -rename *.jpg --db xattr -non-strict --filter camera --format {camera.model}/{fn}


Organize photos by country:

Code: Select all

filebot -rename *.jpg --db xattr -non-strict --filter location --format {location.country}/{fn}


View xattr metadata for each file:

Code: Select all

filebot -mediainfo -r . --format {json}
My (very excellent) support depends on Windows Store and Mac App Store sales and PayPal donations. Paying users, donors and everyone who contributes to FileBot in one way or another will get the very best support.

Image

Please read the FAQ and How to Request Help. Donate if you'd like some extra developer love. :ugeek:

Return to “Scripting and Automation”

Who is online

Users browsing this forum: No registered users and 1 guest