FIND YOUR NEXT FEW LINES

Results for “run”

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

2246 snippets foundClear filters
Linux CommandsFiles & folders

Show the current directory

Print the absolute path of your current working directory before running commands that depend on relative paths.

directory✓ Tested
Linux CommandsText processing

Show the first lines of a file

Read only the first three lines of a text file, useful for checking a header or previewing a large log.

head✓ Tested
Linux CommandsSystem information

Show the Linux distribution version

Read the distribution-provided operating system name and version from os-release.

os✓ Tested
Bash ScriptsArguments & decisions

Skip selected iterations in a loop

Bash Scripts: Continue starts the next iteration without running the remaining loop body.

Bash Scripts✓ Tested
PythonDates & time zones

Skip weekends when advancing dates

Python: Walk calendar dates and count only Monday through Friday.

Python✓ Tested
JavaCollections

Sort a list

Sort a mutable Java list in natural ascending order.

Java✓ Tested
PowerShellGetting Started

Sort a sequence of numbers

PowerShell: Sort a sequence of numbers using PowerShell 7.

PowerShell✓ Tested
Linux CommandsGetting Started

Sort a small set of lines

Linux Commands: Sort a small set of lines using GNU/Linux commands in an empty practice directory.

Linux Commands✓ Tested
C++Collections

Sort a vector

Sort C++ integer values in ascending order.

C++✓ Tested
RustVectors & slices

Sort a vector in ascending order

Sort a vector in ascending order in a complete Rust program using the standard library.

Rust✓ Tested
CArray transformations

Sort an integer array with qsort

C: The comparator uses relational comparisons to avoid subtraction overflow.

C✓ Tested
Linux CommandsText processing

Sort and deduplicate lines

Sort lines alphabetically and remove duplicate lines in a predictable C locale.

sort✓ Tested