Skip to content

Repository files navigation

shed

shed is a console utility that moves stale root items from a selected folder into ~\Shed.

It is meant for quick, reversible cleanup of busy folders such as Downloads. Before moving anything, shed shows an interactive confirmation screen with the selected items and total size.

Important

Windows-only. I'm sorry. Please write the code for your OS yourself. You might want to take a look at the _windows.go files.

Usage

shed [--age days=0] [folder]

Examples:

shed
shed C:\Users\name\Downloads
shed --age 0 docs\plans
shed --age 30 .
shed . --age 30
shed --help

Arguments:

  • folder: folder to scan. Defaults to the current working directory.
  • --age: minimum item age in whole days. Defaults to 0, which treats every eligible root item as stale. Positive values use the file modified date and folder creation date.

Flags may be placed before or after the folder.

What It Moves

shed scans only direct children of the selected folder. Nested files are moved only when their root folder is moved.

It skips hidden items and items whose metadata or size cannot be read safely.

On the confirmation screen, all stale items are selected by default. Press space to select or deselect the focused item, or a to select or deselect all items.

Moved items are placed under:

~\Shed\<yyyy>\<MM>\<bucket-source-path>

If a file or symlink name already exists in the target Shed bucket, shed adds a numbered suffix. If a folder name already exists, shed merges the folder contents using the same conflict rules recursively.

Note

This only works on the system drive.

Shed Pruning

At startup, shed checks for Shed months older than six months. If any are found, it asks whether to send those months to the Recycle Bin before continuing with shedding.

Build And Test

go build ./cmd/shed
go test ./...

Related

  • big — Terminal utility for finding the largest immediate entries inside a folder. Go

About

CLI that moves stale root items from a selected folder into ~\Shed

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages