FIND YOUR NEXT FEW LINES

Results for “File operations & integrity”

Small, practical examples. Search by task or narrow things down below.

947 snippets foundClear filters
CFile positioning & lifecycle

Replace bytes at a known position in a binary file

C: Open in update mode and seek before writing a fixed-size replacement.

C✓ Tested
GitMerging & replaying changes

Resolve a merge by writing the intended final file

Git: After a conflict, edit the result, stage it, and finish the merge commit.

Git✓ Tested
GitRestoring & revising local work

Restore a file’s content from an older commit

Git: Specify a source revision when the desired contents are not in the current index.

Git✓ Tested
Docker / ComposeExecution & file transfer

Retrieve a file from a stopped container

Docker / Compose: The writable layer remains available for docker cp after exit.

Docker / Compose✓ Tested
Linux CommandsFinding & selecting files

Run a command safely for each matching file

Linux Commands: Use find -exec with argument placeholders so spaces in filenames remain intact.

Linux Commands✓ Tested
Docker / ComposeGetting Started

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
Docker / ComposeStorage & isolation

Run with a read-only root filesystem

Add a temporary writable location while protecting the image filesystem.

read-only✓ Tested
Linux CommandsText processing

Search for text in a file

Find matching lines with their line numbers, ignoring letter case and treating the pattern as literal text.

grep✓ Tested
GitWorking tree & staging

See changed files

Show a concise working-tree status.

status✓ Tested
GoFiles & paths

Separate a filename extension

Separate a filename extension using a complete Go program with explicit sample inputs.

Go✓ Tested
Linux CommandsStreams & byte tools

Set a file to a specific byte length

Linux Commands: Use truncate to shorten a known scratch file without replacing its inode.

Linux Commands✓ Tested
Docker / ComposeCompose service options

Set a service’s open-file limit

Docker / Compose: The ulimits mapping defines soft and hard resource limits.

Docker / Compose✓ Tested