linux redirect output multiple commands file

February 15, 2011

i queried for linux redirect output multiple commands file and wasn’t satisfied.  I figured out the solution and am sharing it here for folks

Issue?
Need to run multiple commands in a row and append output to the same file (linux)

Solution?
use a semicolon in between each command

Example:

rm -f 2000000.txt;ping+ 192.168.2.10 1450 5 15 > 2000000.txt;ping+ 192.168.2.10 1450 10 15 >> 2000000.txt;ping+ 192.168.2.10 1450 15 15  >> 2000000.txt;ping+ 192.168.2.10 1450 20 15  >> 2000000.txt;cat 2000000.txt