Skip to content

Add option to mv to remove empty directories #846

@larkost

Description

@larkost

If you s5cmd mv data from a local source with nested directory structure to s3 it leaves all of the directories behind. It would be very helpful to have an option to remove empty directories as it works, so all you would be left with is directory hierarchies that had excluded files in them.

For example if you have:
outer/
to_exclude.txt
inner/
alpha.txt

And ran:
s5cmd mv --remove-empty-dirs --exclude to_exclude.txt outer/ s3://bucket/something

You would wind up only having (locally):
outer/
to_exclude.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions