[bash] FileBot Command-Line Usage Examples

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

[bash] FileBot Command-Line Usage Examples

Post by rednoah »

⭑⭑ A more beginner-friendly set of filebot usage examples is being curated via command.md on GitHub. ⭑⭑

Call filebot with many files:

Shell: Select all

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

Shell: Select all

find . -type d -exec filebot -rename -non-strict {} ';'
Rename files and episodes in linear order:

Shell: Select all

filebot -list --q Firefly --filter regular --format {plex.name} -rename *.mp4
Rename files and episodes in linear order using --filter to select a specific interval of episodes:

Shell: Select all

filebot -list --q "The Daily Show" --filter "airdate >= /2007-01-08/" -rename -r .
Create empty test files:

Shell: 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:

Shell: Select all

filebot -mediainfo -r . --format "touch -t {d.format 'YYYYMMdd0000'} {quote f}" | sh -x
Create new structure with Jackie Chan movies:

Shell: Select all

filebot -rename -r . --db xattr --action hardlink --output 'Jackie Chan' --filter 'actors =~ /Jackie Chan/'
Create new structure by genre:

Shell: Select all

filebot -rename -r . --db xattr --action hardlink --output 'By Genre' --filter genre --format {genre}/{plex.name}
Create new structure by director:

Shell: Select all

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

Shell: Select all

filebot -rename -r . --db xattr --output 'Old Movies' --filter 'movie && y < 1970'
Copy recently aired episodes:

Shell: Select all

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

Shell: Select all

filebot -mediainfo -r . --filter 'genres =~ /Science Fiction/' --format {f}
Delete non-English subtitles:

Shell: Select all

filebot -mediainfo -r . --filter 'f.subtitle && !(lang =~ /eng/)' --format {f} | xargs -I % rm -v %
Rename and organize photos by date taken:

Shell: 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:

Shell: Select all

filebot -rename *.jpg --db xattr -non-strict --filter exif --format {y}/{fn}
Organize photos by camera:

Shell: Select all

filebot -rename *.jpg --db xattr -non-strict --filter camera --format {camera.model}/{fn}
Organize photos by country:

Shell: Select all

filebot -rename *.jpg --db xattr -non-strict --filter location --format {location.country}/{fn}
View xattr metadata for each file:

Shell: Select all

filebot -mediainfo -r /input --format {json}
Sum up the total runtime of all video files:

Shell: Select all

filebot -mediainfo -r /input --filter f.video --format '{minutes} {f}' | awk '{ print $0; sum += $1 } END { print sum }'
:idea: Please read the FAQ and How to Request Help.
Post Reply