Posts

Showing posts from September, 2025

awk - unix

Simple Examples Extract and print a first column from the input ps | awk '{print $1}' Extract and print a multiple columns from the input with space between each column ps | awk '{print $1, $3}' Extract and print a multiple columns from the input without space ps | awk '{print $1$3}' Extract and print a multiple columns from the input with various formatting ps | awk '{print $1">>"$2"\t"$3}' Extract and print multiple on new lines ps | awk '{print $1; print $2;}' Extract and print a columns without newline at the end ps | awk '{printf $1">>"$2">>"$3"**"}' BEGIN block This block is executed only once before processing first row in the input ps | awk 'BEGIN { print "Header" } {print $1}' ps | awk 'BEGIN { print "Header"; print "SubHeader"; } {print $1}' END block This block is executed only once before processing first row in th...

uv - python dependency manager

This article explains the essential uv commands to manage python version, python projects and to run python script with dependencies UV Installation and Global Config Install UV using brew on mac brew install uv Install UV using pip pip install uv --upgrade Other installation options https://docs.astral.sh/uv/getting-started/installation View available python versions uv python list List the python version and path used uv python find uv run python --version Install specific versions of python uv python install 3.10 3.12 Uninstall python versions uv python uninstall 3.10 3.12 Pin default global python version uv python pin 3.10 --global Unpin default global python version uv python pin --rm --global Python Project Init a project uv init --vcs none --no-readme Sync a project virutal environment and update the lock file uv sync Sync a project in CI without updating lock file uv sync --locked Pin a python version to project uv python pin 3.10 Unpin a python version from project uv python ...