Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

Vagrant - Remove all boxes

$ vagrant box list | cut -f 1 -d ' ' | xargs -L 1 vagrant box remove -f

# This command does the following:

# 1. `vagrant box list`: Prints out a list of all installed vagrant boxes (with two columns—box name or path, and meta info)
# 2. `cut -f 1 -d ' '`: Cuts the list and takes out just the first column (using spaces to delimit the columns)
# 3. `xargs -L 1 vagrant box remove -f`: Use xargs to run one command per line, running the command vagrant box remove -f [box name from list/cut].

# You can use `xargs -t` option to output the commands being run just before they're executed.
Source by www.jeffgeerling.com #
 
PREVIOUS NEXT
Tagged: #Vagrant #Remove #boxes
ADD COMMENT
Topic
Name
3+3 =