Results for “per”
Small, practical examples. Search by task or narrow things down below.
Read the byte size of a regular file
C++: file_size reads filesystem metadata without loading file contents.
C++✓ Tested
Read the last array element
PowerShell: A negative array index counts backward from the end.
PowerShell✓ Tested
Read the target stored in a symbolic link
Linux Commands: Use readlink without resolving the target path.
Linux Commands✓ Tested
Remove an empty directory only
Linux Commands: Use rmdir so a directory containing files cannot be removed accidentally.
Linux Commands✓ Tested
Remove an indexed element and compact the array
Bash Scripts: Unsetting an element leaves a gap; reassigning the values creates consecutive indices.
Bash Scripts✓ Tested
Remove collection items that satisfy a condition
Java: Use removeIf on a mutable collection to avoid changing it manually inside a for-each loop.
Java✓ Tested
Remove duplicate values while keeping the smallest key
SQL: Identify retained keys in a grouped subquery before deleting other copies.
SQL✓ Tested
Remove duplicate values while keeping the smallest key
SQL Server: Identify retained keys in a grouped subquery before deleting other copies.
SQL Server✓ Tested
Remove duplicate values while keeping the smallest key
Postgres: Identify retained keys in a grouped subquery before deleting other copies.
Postgres✓ Tested
Remove duplicate values while keeping the smallest key
SQLite: Identify retained keys in a grouped subquery before deleting other copies.
SQLite✓ Tested
Rename a file in its current directory
PowerShell: Rename-Item changes the name without moving the item to another directory.
PowerShell✓ Tested
Rename a file with mv
Linux Commands: Rename a known file in the current directory and inspect its new contents.
Linux Commands✓ Tested