Skip to content

file-management-utils

Latest

Choose a tag to compare

@theyee0 theyee0 released this 15 Aug 05:27
· 1 commit to main since this release

Provides bugfixes and implements some additional operations. The following should now be usable:

./manage.sh [OPTIONS] SOURCE

-f, ---flatten-directory
Copies all nested files to a flat, specified output directory, set with -o

-e, ---list-extensions
Traverses all files in SOURCE and prints filename extensions to stdout

-n, ---list-filenames
Prints all filenames in SOURCE

-c, ---copy-regex pattern
Copy all files from SOURCE matching pattern to a flat, specified output directory, set with -o

-d, ---delete-regex pattern
Delete all files matching a pattern

-t, ---trash-regex pattern
Trash all files matching pattern to ˜/.local/Trash

-m, ---move-regex pattern
Moves all files matching pattern to a flat, specified output directory, set with -o

-o, ---output
Sets the output directory; default is the current directory

-h, ---help
Displays help

--copy-stdin
Copies all files piped in through stdin into the output directory

--delete-stdin
Deletes files piped in through stdin

--trash-stdin
Trashes files piped in through stdin to ˜/.local/Trash

--move-stdin
Moves all files piped in through stdin into a flat output directory, set with -o

--substitute-regex matched-pattern,substituted-string
Copies files containing matched-pattern into an output directory set with -o while preserving nesting and substituting all substrings matched-pattern with substituted-string. If the destructive flag is set, this operation will be done in-place.

--clip-regex-end pattern
Copies files ending in pattern into an output directory set with -o while preserving nesting and truncating the ending pattern. If the destructive flag is set, this operation will be done in-place.

--copy-extension pattern
Copies all files ending in pattern to the a flat specified output directory set with -o. The leading . is not automatically added to pattern

--delete-extension pattern
Deletes files ending in pattern. The leading . is not automatically added to pattern

--trash-extension
Trashes files ending in pattern to ˜/.local/share/Trash. The leading . is not automatically added to pattern

--move-extension
Moves all files ending in pattern to the a flat specified output directory set with -o. The leading . is not automatically added to pattern

--destructive
Indicates that the source of the files does not need to be preserved. In renaming or substitution operations, this will cause the files to be renamed in place. In -f/--flatten, this will automatically destroy the input directory.