Results for “list files”
Small, practical examples. Search by task or narrow things down below.
Extract a filename from a path
Linux Commands: Use basename with an explicit suffix when removing a known extension.
Linux Commands✓ Tested
Extract a parent directory from a path
Linux Commands: Use dirname without needing the path to exist.
Linux Commands✓ Tested
Handle a failed file open through stream state
C++: An unopened input stream is not an empty successful file read.
C++✓ Tested
Handle a filename that begins with a dash
Linux Commands: Use -- to terminate command options before an unusual filename.
Linux Commands✓ Tested
Identify headers for individual table rows
HTML: Scope row associates the first header cell with the data cells in that row.
HTML✓ Tested
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
Inspect changes to a container’s writable layer
Docker / Compose: diff marks added, changed, and deleted filesystem paths.
Docker / Compose✓ Tested
Join portable path components
Join portable path components using a complete Go program with explicit sample inputs.
Go✓ Tested
Limit a search to the immediate directory
Linux Commands: Use maxdepth with type f to exclude nested files and directories.
Linux Commands✓ Tested
Make a script executable by its owner
Linux Commands: Add the owner execute bit without replacing all permission bits.
Linux Commands✓ Tested
Match filenames without case sensitivity
Linux Commands: Use iname for a case-insensitive filename pattern.
Linux Commands✓ Tested
Match one of several values
Use IN to avoid repeating equality conditions.
IN✓ Tested