How can I install all brew packages listed in a text file? Does Homebrew offer anything similar to pip's pip install -r requirements.txt feature? I have a new MacBook Pro arriving today, so one of the first tasks will be to migrate my brew installations. I've already performed a brew list &gt; brew.txt command. Will I be able to use this to install all the packages it lists in one command on the new machine?
xargs brew install &lt; brew.txt


No need to cat the file (see Useless Use of Cat Award) and xargs instead of a for loop to avoid IFS.