Results for “recursive”
Small, practical examples. Search by task or narrow things down below.
Enumerate matching files recursively
C#: Sort relative filenames when reproducible traversal output is required.
C#✓ Tested
Exclude a directory from a recursive search
Linux Commands: Use prune to avoid descending into generated dependencies.
Linux Commands✓ Tested
Find matching files recursively
Python: Use rglob and sorted relative paths for a reproducible recursive file listing.
Python✓ Tested
Find matching files recursively
PowerShell: Select files explicitly and sort their names for predictable presentation.
PowerShell✓ Tested
Generate a bounded sequence recursively
Use a recursive CTE with a recursion limit.
recursive CTE✓ Tested
Generate numbers with a recursive CTE
Build a bounded sequence using SQL recursion.
recursive CTE✓ Tested
List regular files recursively in sorted order
C++: Collect relative paths before sorting because directory iteration order is unspecified.
C++✓ Tested
Use a recursive function for a bounded calculation
Bash Scripts: A recursive factorial demonstrates local variables and a clear base case.
Bash Scripts✓ Tested
Visit files recursively
Java: Close the stream returned by Files.walk and sort relative paths for stable output.
Java✓ Tested
Find files by extension
Search a directory tree for regular files with a particular extension and print their paths.
find✓ Tested
Copy a directory while preserving attributes
Linux Commands: Use cp -a for a recursive local copy that preserves links and ordinary file attributes.
Linux Commands✓ Tested
Delete only a named scratch file
PowerShell: Use LiteralPath and avoid recursive removal for a single known file.
PowerShell✓ Tested