FIND YOUR NEXT FEW LINES

Results for “list files”

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

467 snippets foundClear filters
GoFiles & paths

Reject an escaping relative path

Reject an escaping relative path using a complete Go program with explicit sample inputs.

Go✓ Tested
Linux CommandsFiles & permissions

Remove an empty directory only

Linux Commands: Use rmdir so a directory containing files cannot be removed accidentally.

Linux Commands✓ Tested
Linux CommandsFiles & permissions

Rename a file with mv

Linux Commands: Rename a known file in the current directory and inspect its new contents.

Linux Commands✓ Tested
ReactLists & filtering

Render a helpful empty state

Render a helpful empty state with a small React component and explicit browser behavior.

React✓ Tested
ReactLists & filtering

Render a semantic data table

Render a semantic data table with a small React component and explicit browser behavior.

React✓ Tested
AngularLists & control flow

Render groups with nested loops

Render groups with nested loops with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
ReactLists & filtering

Render nested groups with stable keys

Render nested groups with stable keys with a small React component and explicit browser behavior.

React✓ Tested
Linux CommandsFinding & selecting files

Run a command safely for each matching file

Linux Commands: Use find -exec with argument placeholders so spaces in filenames remain intact.

Linux Commands✓ Tested
GoFiles & paths

Separate a filename extension

Separate a filename extension using a complete Go program with explicit sample inputs.

Go✓ Tested
HTMLTables & list numbering

Separate table headings data and totals

HTML: Thead, tbody, and tfoot group rows according to their purpose.

HTML✓ Tested
HTMLTables & list numbering

Set consistent widths for table columns

HTML: A colgroup applies presentation to whole columns without repeating styles on every cell.

HTML✓ Tested
Linux CommandsFiles & permissions

Set owner-only file permissions

Linux Commands: Use chmod 600 to allow only the owner to read and write a file.

Linux Commands✓ Tested