Git Product home page Git Product logo

file-arranger's Introduction

Arranger

Simple & Capable files arranger

About

Arranger is a CLI file arranger written in Perl
It cleans up your Directory by moving files to their corresponding Directory by their file extension
jpg, png, jpeg webp -> Images
mp4, mkv, avi, flv -> Videos
and other common filetype extensions

Features

Arranger can

  • control maxdepth when arranging
  • delete empty Directories
  • save logs of what exactly happend
  • revert the move using logfile
  • move only specific files by provided file extensions & Directory
  • arrange more than one Directory
  • move unrecognised filetypes to 'Other' Directory

installation

Its just a perl script download it make it executable and put somewhere in your $PATH

with wget

wget https://raw.githubusercontent.com/anhsirk0/file-arranger/master/arranger.pl -O arranger

or

with curl

curl https://raw.githubusercontent.com/anhsirk0/file-arranger/master/arranger.pl --output arranger

making it executable

chmod +x arranger

Usage

arranger [dirs] [options]

will arrange current Directory
see examples for detailed usage

Screenshots

arranger with no arguements

out1.png

arranger moving specific files to provided dir

arranger -ext py -dir Python out2.png

arranger reversing the move via a logfile

arranger -rev -logfile arrange_log out3.png

arranger not saving logs and not moving unrecognised filetypes to 'Other'

arranger -no-log -no-unknown out4.png

arranger arranging given Directories

arranger folder1 folder2 out5.png

arranger dry-run

arranger -dry-run dry.png

Examples

arranger mydir1 mydir2 mydir3

will arrange mydir1 mydir2 mydir3 Directories one by one

arranger -no-log

arrange current Directory and wont save logfile

arranger -delete-empty 

arrange current Directory and also delete empty Directories

arranger -delete-empty -no-arrange

only delete empty Directories , wont arrange

arranger -no-unknown 

arrange current Directory and wont move files with unrecognised extensions

arranger -ext pl -dir "Perl" 

move all files with pl extension to Directory 'Perl'

arranger -ext jpg png jpeg svg -dir "Images" 

move all files with any of {jpg, png, jpeg, svg} extension to Directory 'Images'

Tweaking arranger via config file

you need to create a file ~/.config/arranger/arranger.conf

you can download the sample config file and move it into the config Directory

wget https://raw.githubusercontent.com/anhsirk0/file-arranger/master/arranger.conf

or

with curl

curl https://raw.githubusercontent.com/anhsirk0/file-arranger/master/arranger.conf --output arranger.conf

move to config dir

mv arranger.conf ~/.config/arranger/arranger.conf

About config file

  • everything should be single space separated(no trailing spaces)
  • first word of line would be Directory name rest would be file extensions associated with that Directory

Available options

-m or --maxdepth=INT specify maxdepth (> 1)
-h or --help show this help message
-dry or --dry-run show what will happen without actually arranging
-v or --verbose print file name while moving
-rev or --revert revert the move (require a logfile)
-log or --logfile=STR specify logfile (required for reverting)
-no-log dont save log
-no-unknown dont move unrecognised filetypes
-no-arrange dont move any file (helpful if you only want to delete empty dirs)
-delete-empty delete empty directories (if any)
-ext or --extensions=STRs specify extension(s) to move (requires a Directory)
-dir or --directory=STR specify the Directory to move files in (required by -ext)

file-arranger's People

Contributors

anhsirk0 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.