Share

Twitter Facebook

Settings

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

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

  • xcrun: error: invalid active developer path
  • Useful debugging tools for kubernetes
  • Template for persistent volumes on helm charts
  • Setup of a development machine
  • Fixing etcdDatabaseHighFragmentationRatio prometheus alert

Categories

k8s9 kubernetes3 aws2 go2 linux2 terraform2 ansible1 cicd1 docker1 k3s1

Tags

k8s7 aws3 kubernetes3 cli2 debug2 docker2 etcd2 git2 iam2 linux2
©2024, All Rights Reserved