FIND YOUR NEXT FEW LINES

Results for “file check”

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

1328 snippets foundClear filters
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
Linux CommandsFinding & selecting files

Find empty regular files

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

Linux Commands✓ Tested
Linux CommandsFiles & folders

Find files by extension

Search a directory tree for regular files with a particular extension and print their paths.

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

Find matching files recursively

Python: Use rglob and sorted relative paths for a reproducible recursive file listing.

Python✓ Tested
PowerShellFile operations & integrity

Find matching files recursively

PowerShell: Select files explicitly and sort their names for predictable presentation.

PowerShell✓ 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
C++Filesystem operations

Handle a failed file open through stream state

C++: An unopened input stream is not an empty successful file read.

C++✓ Tested
Bash ScriptsFiles & reliability

Handle a filename pattern with no matches

Use nullglob so an unmatched pattern produces an empty array.

nullglob✓ Tested