FIND YOUR NEXT FEW LINES

Results for “filename”

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

35 snippets foundClear filters
Linux CommandsArchive integrity & packaging

Archive filenames safely with null delimiters

Linux Commands: Use find -print0 with tar --null to preserve spaces and embedded newlines in filenames.

Linux Commands✓ Tested
JavaText validation & formatting

Check a filename suffix

Java: Use endsWith for a case-sensitive literal suffix test.

Java✓ Tested
CStrings & byte buffers

Check a literal filename suffix

C: Check lengths before subtracting so a short input cannot produce an invalid pointer.

C✓ Tested
Bash ScriptsArguments & decisions

Classify a filename with shell patterns

Bash Scripts: Case patterns support alternatives without launching an external regex tool.

Bash Scripts✓ Tested
Linux CommandsArchive integrity & packaging

Compress a stream to a chosen filename

Linux Commands: Use gzip -c to leave the source file untouched and choose the destination explicitly.

Linux Commands✓ 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
PythonFile operations & archives

Extract filename components

Python: Use pathlib properties to separate a directory, filename stem, and suffix.

Python✓ 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
RustFiles & paths

Inspect a path’s filename and extension

Inspect a path’s filename and extension in a complete Rust program using the standard library.

Rust✓ Tested
GitInspecting the working tree

List only staged filenames

Git: The cached diff compares the index with HEAD rather than comparing working files with the index.

Git✓ Tested
Linux CommandsFinding & selecting files

Match filenames without case sensitivity

Linux Commands: Use iname for a case-insensitive filename pattern.

Linux Commands✓ Tested