Results for “Linux Commands”
Small, practical examples. Search by task or narrow things down below.
Preserve a failure status while an EXIT trap runs
Bash Scripts: Capture the status immediately on entry to the trap before running cleanup commands.
Bash Scripts✓ Tested
Preserve key insertion order
PowerShell: An ordered dictionary enumerates keys in the order they were inserted.
PowerShell✓ Tested
Process every array element
PowerShell: Process every array element using PowerShell 7.
PowerShell✓ Tested
Read a collection element
PowerShell: Read a collection element using PowerShell 7.
PowerShell✓ Tested
Read a field from container metadata
Use an inspect template for stable machine-readable output.
inspect✓ Tested
Read a file lazily through the .NET line iterator
PowerShell: ReadLines avoids creating one string containing the entire file.
PowerShell✓ Tested
Read a file size in bytes
PowerShell: The Length property of a file item reports its logical byte size.
PowerShell✓ Tested
Read a tab-separated table
PowerShell: ConvertFrom-Csv accepts an explicit delimiter instead of requiring comma-separated input.
PowerShell✓ Tested
Read a value from a hashtable
PowerShell: Read a value from a hashtable using PowerShell 7.
PowerShell✓ Tested
Read a value from a trusted XML document
PowerShell: The XML adapter exposes a small document’s elements and attributes through named properties.
PowerShell✓ Tested
Read a whole text file
Load text as one string instead of one item per line.
Get-Content✓ Tested
Read JSON into a hashtable
PowerShell: AsHashtable produces dictionary-style results for keys that are data rather than fixed property names.
PowerShell✓ Tested