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
Docker / ComposeDockerfile patterns

Create a runtime file during the build

Docker / Compose: RUN executes during the build while CMD executes when a container starts.

Docker / Compose✓ Tested
Linux CommandsFiles & permissions

Create a second name for the same file

Linux Commands: Use ln for a hard link and inspect the shared link count.

Linux Commands✓ Tested
Docker / ComposeGetting Started

Create a small file at build time

Docker / Compose: Create a small file at build time with a complete introductory Dockerfile.

Docker / Compose✓ Tested
Linux CommandsArchive integrity & packaging

Create an archive from an explicit file list

Linux Commands: Use tar -T for a controlled list of relative archive members.

Linux Commands✓ Tested
Linux CommandsFiles & permissions

Create an empty file

Linux Commands: Use touch to create a file when absent; an existing file keeps its contents but gets updated timestamps.

Linux Commands✓ Tested
Linux CommandsGetting Started

Create an empty practice file

Linux Commands: Create an empty practice file using GNU/Linux commands in an empty practice directory.

Linux Commands✓ Tested
Linux CommandsFiles & permissions

Create private files with a restrictive umask

Linux Commands: Apply umask in a subshell so the surrounding shell is unaffected.

Linux Commands✓ Tested
GitRestoring & revising local work

Discard an unstaged edit to one tracked file

Git: Restore copies the index version back into the selected working file.

Git✓ Tested
ReactCustom hooks

Encapsulate increment and reset operations

Encapsulate increment and reset operations with a small React component and explicit browser behavior.

React✓ Tested
Linux CommandsStreams & byte tools

Encode and decode a file with Base64

Linux Commands: Use GNU base64 for text transport of bytes and --decode for the reverse operation.

Linux Commands✓ Tested
Docker / ComposeDockerfile patterns

Exclude files from the build context

Docker / Compose: A dockerignore file prevents selected local files from being copied.

Docker / Compose✓ Tested
GitInspecting the working tree

Explain which ignore rule matches a file

Git: check-ignore -v reports the source file, line, pattern, and matched path.

Git✓ Tested