#directory #group #organize #command-line-tool #name #filenames #mode

app group_files_into_dirs

Group files into directories based on keywords

6 releases

new 0.3.0 Dec 12, 2024
0.2.1 Aug 14, 2024
0.1.2 Aug 12, 2024

#946 in Command line utilities

Download history 43/week @ 2024-08-16 9/week @ 2024-09-13 12/week @ 2024-09-27 2/week @ 2024-10-04

476 downloads per month

MIT license

41KB
1K SLoC

group_files_into_dir

a CLI tool to group files into directories based on their filenames.

group_files_into_dir

Installation

Download binary file from releases page and put it in a path directory.

or using cargo to Install

cargo install group_files_into_dir

or build from source.

git clone https://github.com/craftgear/group_files_into_dirs
cargo build --release

Usage

Interactive mode (default)

extract keywords from filenames. delimiters are ,_- and braces ()[]{} . if you use spaces as delimiters, then add -s option.

  • dir - directory to group files in.
group_files_into_dir <dir>

specify keywords by yourself

  • keywords - words to use for grouping files, comma separated.
  • dir - directory to group files in.
group_files_into_dir -k <keywords> <dir> 

use directory name as keyword

Once you've created directories with interactive mode or specific keywords mode, this mode would be your daily driver.

With -d option, you can group files into directories based on directory names.

Let's say you have inquiry directory and quote directory in docs directory. Now when you put inquiry_2021-01-01.txt and quote_2021-01-01.txt in docs directory, you can move them into inquiry and quote directories with this mode.

  • dir - directory to group files in.
group_files_into_dir -d <dir> 

Example

# invoke interactive mode (default)
# then ask you to select keywords.
group_files_into_dir ./
# group files in current directory based on keywords "hello" and "world"
# no keyword selection prompt will be shown.
group_files_into_dir -k "hello,world" ./
# now you can occasionally organize files with -d option.
group_files_into_dir -d ./

LICENSE

MIT License

Dependencies

~13–24MB
~367K SLoC