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
CSSVisual treatment & accessibility

Paint a gradient without an image file

CSS: Linear-gradient generates a CSS background image from color stops.

CSS✓ Tested
Linux CommandsFinding & selecting files

Pass filenames with spaces through xargs

Linux Commands: Use null delimiters end to end instead of splitting filenames on whitespace.

Linux Commands✓ Tested
Bash ScriptsDiagnostics & defensive scripting

Prevent a variable value from expanding as a filename pattern

Bash Scripts: Quote a variable to pass its literal contents even when matching filenames exist.

Bash Scripts✓ Tested
GitRestoring & revising local work

Preview removal of an untracked scratch file

Git: The dry-run flag shows what clean would remove without deleting it.

Git✓ Tested
Linux CommandsTransforming text

Print the final lines of a file

Linux Commands: Use tail -n for a fixed-size suffix of a log.

Linux Commands✓ Tested
Docker / ComposeCompose service options

Protect a Compose service’s root filesystem

Docker / Compose: read_only rejects writes to the image filesystem.

Docker / Compose✓ Tested
Docker / ComposeCompose applications

Put an optional service behind a profile

Keep a utility service separate from a normal Compose startup.

Compose✓ Tested
GitCommits & history

Read a file from a commit

Inspect committed content without changing your working copy.

show✓ Tested
GitGetting Started

Read a file from the latest commit

Git: Read a file from the latest commit inside the disposable repository created by the input setup.

Git✓ Tested
GitCommit history & revision selection

Read a file from the parent commit

Git: HEAD~1 names the first parent one generation before HEAD.

Git✓ Tested
Bash ScriptsLoops & decisions

Read a file without losing its last line

Handle spaces, backslashes, and a final line without a newline.

read lines✓ Tested
PythonJSON & CSV

Read a JSON file

Load a JSON document from disk into Python objects using an explicitly selected text encoding.

json✓ Tested