FIND YOUR NEXT FEW LINES

Results for “File operations & paths”

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

946 snippets foundClear filters
SQLiteBulk changes & set operations

Insert only keys absent from a destination

SQLite: NOT EXISTS supports a set-based missing-row insert in a single-writer example.

SQLite✓ Tested
Bash ScriptsArray operations

Join array items with a one-character separator

Bash Scripts: A local IFS controls the separator used by the quoted star expansion.

Bash Scripts✓ Tested
Docker / ComposeDockerfile patterns

Keep exec-form arguments literal

Docker / Compose: JSON exec form does not expand shell environment variables.

Docker / Compose✓ Tested
Linux CommandsFinding & selecting files

Limit a search to the immediate directory

Linux Commands: Use maxdepth with type f to exclude nested files and directories.

Linux Commands✓ Tested
JavaQueues & collection operations

Locate a value in a sorted array

Java: Use Arrays.binarySearch only after establishing ascending order.

Java✓ Tested
Linux CommandsFiles & permissions

Make a script executable by its owner

Linux Commands: Add the owner execute bit without replacing all permission bits.

Linux Commands✓ Tested
Docker / ComposeStorage & isolation

Mount a host directory read-only

Expose existing files without allowing the container to change them.

bind mount✓ Tested
Linux CommandsFinding & selecting files

Normalize a path without requiring it to exist

Linux Commands: Use GNU realpath -m and relative-to to normalize dot segments.

Linux Commands✓ Tested
Docker / ComposeExecution & file transfer

Override an image’s entrypoint at runtime

Docker / Compose: An explicit entrypoint replaces the image entrypoint for this invocation.

Docker / Compose✓ Tested
Docker / ComposeExecution & file transfer

Override the process working directory

Docker / Compose: The workdir option sets the directory for the container command.

Docker / Compose✓ Tested
Docker / ComposeExecution & file transfer

Pipe input into a container process

Docker / Compose: The interactive flag keeps standard input open without allocating a terminal.

Docker / Compose✓ Tested
Docker / ComposeDockerfile patterns

Prepare an owned directory before dropping root

Docker / Compose: Create and chown the writable application path before USER.

Docker / Compose✓ Tested