← Files Unix CopilotARCHIVED FILE
references/filesystem-operations.md
1.25 KB · Nov 21, 2026 · 12:44 UTC
# Filesystems and bulk changes ## Read-only baseline Use `pwd`, `find`, `stat`, `ls` or `du` according to the platform to verify the actual scope. In remote/shared contexts confirm mount points and ownership. `ls` is for human viewing, not machine-readable filename parsing. ## Selection and dangerous operations Never convert a natural-language deletion request straight to a recursive command. Inspect exact matches first; use a separate mutation step only when scope/authorization is clear. Avoid newline-delimited path lists as transport for arbitrary filenames; prefer `-exec` or documented NUL pipelines. Anticipate symlink traversal, permission failures, races and files appearing between preview and action. ## Replace/move/rename Preserve source, write to a new destination, diff or count results, then replace. `mv` is atomic only under suitable same-filesystem conditions; don't promise universal atomicity. Use backups, interactive/no-clobber options only where documented. ## Validation Matched files, size, hashes, counts, sample diffs, and rollback path are context-dependent. A dry-run never proves the subsequent write succeeded. Primary: GNU findutils https://www.gnu.org/software/findutils/manual/ ; GNU coreutils https://www.gnu.org/software/coreutils/manual/
SHA-256: d1c4e66ee6f7f6862158d425d6086591faf0f40aec9f201a307d176dc56967dd