Results for “Files & paths”
Small, practical examples. Search by task or narrow things down below.
List newly added staged files only
Git: Filter the cached diff by added status while leaving modified files out.
Git✓ Tested
List untracked files while honoring ignore rules
Git: Use others and exclude-standard together to respect repository and global ignore configuration.
Git✓ Tested
Make a Compose service’s filesystem read-only
Docker / Compose: Make a Compose service’s filesystem read-only in a small Compose file.
Docker / Compose✓ Tested
Normalize a path without touching the filesystem
C++: lexically_normal removes redundant dot components using path syntax alone.
C++✓ Tested
Protect a Compose service’s root filesystem
Docker / Compose: read_only rejects writes to the image filesystem.
Docker / Compose✓ Tested
Rename a known file through filesystem
C++: filesystem::rename reports an error by exception when the operation fails.
C++✓ Tested
Run with a read-only container filesystem
Docker / Compose: Run with a read-only container filesystem using a locally available Ubuntu image.
Docker / Compose✓ Tested
Run with a read-only root filesystem
Add a temporary writable location while protecting the image filesystem.
read-only✓ Tested
See changed files
Show a concise working-tree status.
status✓ Tested
Set copied files’ numeric ownership
Docker / Compose: COPY --chown sets ownership while adding the file.
Docker / Compose✓ Tested
Test whether tracked working files changed
Git: A quiet diff returns status one for differences, so handle it in a conditional.
Git✓ Tested
Copy a directory while preserving attributes
Linux Commands: Use cp -a for a recursive local copy that preserves links and ordinary file attributes.
Linux Commands✓ Tested