Linux

Cheatsheete for linux commands

Posted November 22, 2021 by Adrian Wyssmann

General

Set proxy

export http_proxy='http://:@webproxy.intra:8080'
export https_proxy='http://:@webproxy.intra:8080'
export no_proxy=".intra,localhost,.svc.intra"

Check Are HTTP_PROXY, HTTPS_PROXY and NO_PROXY environment variables standard?

Bash

For-loop oneliner

Run a command 5 times:

for i in {1..5}; do COMMAND; done

or

for((i=1;i<=10;i+=2)); do COMMAND; done

Run a particular command for a list of strings

for context in dev-v1 dev-v2 sit uat nop; do echo $context; done

Archlinux

Pacman

error: key “xxxxx” could not be looked up remotely

Problem

When upgrading with pacman the following error occurs

....
downloading required keys...
error: key "xxxxx" could not be looked up remotely
error: required key missing from keyring
error: failed to commit transaction (unexpected error)
Errors occurred, no packages were upgraded.

Solution

Upgrade archlinux-keyring before upgrading the system

sudo pacman -S archlinux-keyring

Reference: ArchLinux Forum

Edit this page