Nothing Special   »   [go: up one dir, main page]

Skip to content

groups files in subdirectories based on a regex pattern

License

Notifications You must be signed in to change notification settings

QazCetelic/rgxdir

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rgxdir

Groups files in a subdirectories based on a regex pattern. I decided to write it in C instead of Rust, because the required crates required several MiB, while the C application is only 12,4KiB in total with UPX.

Usage

Imagine the following directory:

/test
  /a1a
  /a1b
  /a1c
  /a2a
  /a2b
  /a2c
  /b1a
  /b1b
  /b1c
  /b2a
  /b2b
  /b2c

Using rgxdir '^([a-z])([0-9]).$' /path/to/dir/test will result in the following directory structure:

/test
  /a
    /1
      /a1a
      /a1b
      /a1c
    /2
      /a2a
      /a2b
      /a2c
  /b
    /1
      /b1a
      /b1b
      /b1c
    /2
      /b2a
      /b2b
      /b2c