FIND YOUR NEXT FEW LINES

Results for “File operations & paths”

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

946 snippets foundClear filters
GitGetting Started

Read history for one path

Git: Read history for one path inside the disposable repository created by the input setup.

Git✓ Tested
Linux CommandsFiles & permissions

Read the target stored in a symbolic link

Linux Commands: Use readlink without resolving the target path.

Linux Commands✓ 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
Bash ScriptsArray operations

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
JavaQueues & collection operations

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
SQLBulk changes & set operations

Remove duplicate values while keeping the smallest key

SQL: Identify retained keys in a grouped subquery before deleting other copies.

SQL✓ Tested
SQL ServerBulk changes & set operations

Remove duplicate values while keeping the smallest key

SQL Server: Identify retained keys in a grouped subquery before deleting other copies.

SQL Server✓ Tested
PostgresBulk changes & set operations

Remove duplicate values while keeping the smallest key

Postgres: Identify retained keys in a grouped subquery before deleting other copies.

Postgres✓ Tested
SQLiteBulk changes & set operations

Remove duplicate values while keeping the smallest key

SQLite: Identify retained keys in a grouped subquery before deleting other copies.

SQLite✓ Tested
JavaQueues & collection operations

Retrieve the smallest queued value first

Java: PriorityQueue poll removes the smallest value under the natural ordering.

Java✓ Tested
Docker / ComposeExecution & file transfer

Run a one-off process with a numeric user ID

Docker / Compose: The user option overrides the image’s default identity.

Docker / Compose✓ Tested
Bash ScriptsArray operations

Select a range of array elements

Bash Scripts: Quote a sliced at-sign expansion to keep each selected element separate.

Bash Scripts✓ Tested