Results for “run”
Small, practical examples. Search by task or narrow things down below.
Show the current directory
Print the absolute path of your current working directory before running commands that depend on relative paths.
directory✓ Tested
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
Show the Linux distribution version
Read the distribution-provided operating system name and version from os-release.
os✓ Tested
Skip selected iterations in a loop
Bash Scripts: Continue starts the next iteration without running the remaining loop body.
Bash Scripts✓ Tested
Skip weekends when advancing dates
Python: Walk calendar dates and count only Monday through Friday.
Python✓ Tested
Sort a list
Sort a mutable Java list in natural ascending order.
Java✓ Tested
Sort a sequence of numbers
PowerShell: Sort a sequence of numbers using PowerShell 7.
PowerShell✓ Tested
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
Sort a vector
Sort C++ integer values in ascending order.
C++✓ Tested
Sort a vector in ascending order
Sort a vector in ascending order in a complete Rust program using the standard library.
Rust✓ Tested
Sort an integer array with qsort
C: The comparator uses relational comparisons to avoid subtraction overflow.
C✓ Tested
Sort and deduplicate lines
Sort lines alphabetically and remove duplicate lines in a predictable C locale.
sort✓ Tested