Most Frequently Used Linux Commands

AWK

Lets say you want to delete all the docker containers ins the system, you could use the awk command like -


docker ps -a | awk {'print $1'}


Take it a variable

containers = `docker ps -a | awk {'print $1'}`

now- 

for container in $containers; do docker rm $container; done

Comments

Popular Posts