Organise files and folders
Activated Cloud✓ Officialactivated/organise-files-and-folders
Free · MIT
About
Keeps your computer's files findable: one folder per job in your work space with inputs, working and outputs, clear dated and versioned file names, a README per job, the shared Team folder used properly, and tidy-ups done as inventory, approved plan, logged moves you can undo, duplicates found by content, and deletions only to the Trash with the owner's OK. Use for tidy up my files, where did X go, set up a folder for this, or clean out Downloads. Not for scheduling jobs (see schedule-recurring-work).
Documentation
Organise files and folders
Everything you make lives on your own Linux computer, and the owner (and your teammates) must be able to find it without asking you. This skill sets the house rules for where files go and what they are called, and gives a safe method for tidying up. The standard: anyone finds the file they need in under 30 seconds; every move is logged and reversible; nothing is deleted without the owner's yes, and then only to the Trash.
When to use
- Starting any new piece of work (make its folder first).
- "Tidy up your desktop / my Downloads / the shared folder."
- "Where is the report you made last week?"
- "Find and remove the duplicates."
- "Set up a folder structure for this project."
What you need
- The places on your computer:
- Work space:
~/Desktop/<your name> - Work space(the path is in your instructions). One folder per piece of work. - Team folder:
~/Desktop/Team, shared with your teammates and visible to the owner's main agent. Put files there that others need. - Downloads:
~/Downloads, where the browser saves files. An inbox, not a home. - Trash: on your desktop; the owner can restore from it.
- Not
/tmpfor anything anyone will want later; it is cleared.
- Work space:
- For tidying other people's or shared files: the owner's OK on the plan before you move anything.
Method
A. Every new piece of work
- Make the job folder first.
<work space>/<short-name>/, named in words the owner would use (supplier-review,q3-board-deck). Inside:
supplier-review/
README.md what this is, status, owner, key files, last updated
inputs/ what you were given or downloaded; never edited
working/ drafts, scripts, intermediate files, notes
outputs/ what the owner gets; final versions
archive/ superseded versions, if worth keeping
Keep depth to three or four levels. When the owner returns to a piece of work, find its folder and carry on there; do not make a second one. From terminal: mkdir -p "$HOME/Desktop/Ada - Work space/supplier-review"/{inputs,working,outputs} (your own work space name).
Name files so they sort and explain themselves.
YYYY-MM-DD_topic_type_v01.ext, for example2026-10-05_supplier-review_report_v01.docx.- ISO dates first so files sort in time order.
- Lowercase words joined by hyphens; underscores between the parts.
- Versions
v01,v02; never "final", "final2", "new", "latest". Mark the issued version in the README. - No spaces or
/ \ : * ? " < > |inside names you create; under about 60 characters. - Keep a source's own name when it carries meaning (an invoice number), prefixed with the date.
Keep a README.md in each job folder (template in
references/file-scripts.md): one paragraph on what the job is, status, where the latest output is, and a dated change log.Move arrivals in at once. Downloads and attachments go from
~/Downloadsinto the job'sinputs/the moment they arrive, renamed by the convention.Share deliberately. When a teammate or the owner's main agent needs a file, copy the output (not your working mess) to
~/Desktop/Team/<job>/and say so in the README.
B. Tidying up
- Inventory first, touch nothing. List every file with path, size, modified date, type and a content hash (script in
references/file-scripts.md). Save it asinventory.csvin atidy-upjob folder. The core of the script:
import csv, hashlib, os, time
from pathlib import Path
ROOT, JOB = Path("/home/user/Downloads"), Path("/home/user/Desktop/Ada - Work space/tidy-up")
JOB.mkdir(parents=True, exist_ok=True)
rows = []
for d, dirs, files in os.walk(ROOT):
dirs[:] = [x for x in dirs if not x.startswith(".")]
for name in files:
p = Path(d) / name
if name.startswith(".") or p.is_symlink():
continue
st = p.stat()
digest = hashlib.sha256(p.read_bytes()).hexdigest() if st.st_size < 200_000_000 else "skipped-large"
rows.append([str(p), p.suffix.lower(), st.st_size, time.strftime("%Y-%m-%d", time.localtime(st.st_mtime)), digest])
with open(JOB / "inventory.csv", "w", newline="", encoding="utf-8") as f:
csv.writer(f).writerows([["path", "ext", "bytes", "modified", "sha256"], *rows])
print(len(rows), "files,", round(sum(r[2] for r in rows) / 1e6, 1), "MB")
Read the inventory. Group by type and age; find duplicates by hash (same content, different names), very large files, old downloads, empty folders, and files whose names say nothing (
Document (3).pdf,IMG_2231.jpg). Open a sample of unclear files to see what they are.Write a plan as a table: current path, proposed path or action (move, rename, archive, delete), reason. Show it with
show_card(typetable) and get the owner's OK for anything outside your own work space, and for every deletion.Dry run. Print every move the script would make; check there are no collisions (two files to one name) and nothing outside the agreed folders.
Apply with a manifest. Move and rename with the script, writing each
old_path, new_pathtomanifest-<date>.csv. If anything links to files by path (documents, scripts, shortcuts), update or report the links.Delete only to the Trash, only what the owner approved, and record it in the manifest. Duplicates: keep the copy in the most sensible place (usually the newest in the job folder) and trash the others.
Check and report. Re-run the inventory: file count before = after + trashed. Report what moved, what is in the Trash, space freed, and how to undo (the manifest).
Output
- For new work: the job folder with its README, and the full path given to the owner the first time you mention a file.
- For a tidy-up, a short report (and a
show_cardtable of the main moves):
Tidied [folder]: [n] files moved into [m] job folders, [k] duplicates and [j] old downloads moved to the Trash ([x] MB freed).
Nothing deleted permanently. Undo: manifest at [path].
Needs you: [files I could not place], [anything in the Team folder I did not touch].
- For "where is it?": the full path, what the file is, its date and version, and whether a newer version exists.
Checks before you finish
- Nothing deleted outright; trashed items listed and approved.
- Manifest saved; the undo script works from it.
- File counts reconcile before and after.
- No files moved out of the Team folder that teammates rely on, without telling them.
- Each job folder you touched has a current README.
Pitfalls
rm -rfwith a variable. One empty variable and the command removes the wrong tree. Use the scripts here, which move to the Trash and log, and quote every path (work space names contain spaces).- Duplicates by name. Same name is not same file. Compare content hashes.
- Breaking links. Renaming files referenced by documents, spreadsheets or scheduled jobs breaks them. Search for the old name (
search_files) before renaming. - Tidying someone else's live work. Ask before reorganising a teammate's folder or the shared Team folder.
- Leaving work in Downloads or /tmp. Move it into the job folder the moment it arrives.
- Personal or sensitive files (IDs, bank statements, contracts): keep them in the job folder that needs them, do not copy them around, and tell the owner where they are.
See also: schedule-recurring-work (a weekly Downloads tidy), get-tasks-done-in-browser (downloads), status-updates-and-handoffs (handoff notes).
Versions
Listed from the source repository.
Reviews
No reviews yet. Be the first.
