Vacant323
Vacant323

Reputation: 43

Cutting / Formatting a docker service command

Sorry for the imprecise title but i'm actually working on the simpliest way to cut this:

Docker service ls

Into this:

Docker service ls cutted

Tried with some -f but not working. Maybe with some grep/sed/cut stuff but i didnt find a satisfying way...

Thanks a lot for the time

Upvotes: 1

Views: 264

Answers (1)

gile
gile

Reputation: 6006

You can use awk

docker service ls | awk -F" " '{print $2, $4}'

Upvotes: 2

Related Questions