Share

Twitter Facebook

Settings

Go back Reload Copy URL Share
  • Posts
  • Archives
  • Categories
  • Tags
  1. Home
  2. Tags
  3. linux

How to use xargs when the argument should be in the middle of the command

Jan 28, 2022 1 min read xargsclilinux

A lot of times (especially when working with kubernetes) happens that you need to extract certain arguments with one command and use them in the middle of another. A quick way to deal with it is through usage of xargs with -I arg.

For example:

kubectl get ns -o name | xargs -I "{}" kubectl label {}...

Read More
Alexander Chernov
Alexander Chernov
Gopher, PHPer, Devops, SRE
Uk

Recent Posts

  • Prometheus - kube-proxy endpoint connection refused
  • Go test run configuration template in Goland
  • How to expose service behind nat with wireguard and vps
  • How to use xargs when the argument should be in the middle of the command
  • How to mass remove finalizers from argocd applications

Categories

k8s4 aws2 go2 kubernetes2 terraform2 ansible1 cicd1 docker1 k3s1 linux1

Tags

k8s4 aws3 cli2 docker2 iam2 kubernetes2 terraform2 ansible1 backup1 challenge1
©2022, All Rights Reserved