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 / ComposeImage management

Export a container filesystem into a new image

Docker / Compose: export contains filesystem data; import creates a new image from it.

Docker / Compose✓ Tested
GitTags & repository configuration

Export committed files without the Git metadata directory

Git: Git archive creates a snapshot of tracked committed files only.

Git✓ Tested
ReactCustom hooks

Expose immutable collection operations

Expose immutable collection operations with a small React component and explicit browser behavior.

React✓ Tested
Linux CommandsFinding & selecting files

Extract a filename from a path

Linux Commands: Use basename with an explicit suffix when removing a known extension.

Linux Commands✓ Tested
Linux CommandsFinding & selecting files

Find empty regular files

Linux Commands: Use the empty predicate with a file type constraint.

Linux Commands✓ Tested
Linux CommandsFinding & selecting files

Find files larger than a byte threshold

Linux Commands: Use the c suffix for exact byte units with GNU find size tests.

Linux Commands✓ Tested
Linux CommandsSorting & joining records

Find lines common to two sorted files

Linux Commands: Use comm -12 to suppress the two columns of unmatched lines.

Linux Commands✓ Tested
Linux CommandsSorting & joining records

Find lines unique to the first sorted file

Linux Commands: Use comm -23 to retain only records absent from the second input.

Linux Commands✓ Tested
GitGetting Started

Find text inside tracked files

Git: Find text inside tracked files inside the disposable repository created by the input setup.

Git✓ Tested
Bash ScriptsFiles & reliability

Handle a filename pattern with no matches

Use nullglob so an unmatched pattern produces an empty array.

nullglob✓ Tested
Linux CommandsFiles & permissions

Handle a filename that begins with a dash

Linux Commands: Use -- to terminate command options before an unusual filename.

Linux Commands✓ Tested
CFile positioning & lifecycle

Handle a missing file without treating it as an empty file

C: Inspect errno after a failed fopen to distinguish the documented missing-path condition.

C✓ Tested