Actually you can put it in parenthesis. Following command has worked for me.
(perf stat -x, ../bin/sort data >/dev/null) 2>perfoutput.txt
문제
I am using perf
tool to analyze sort utility . I gave following command.
perf stat -x, ../bin/sort data >/dev/null 2>perf_data
I want to redirect the output of sort to /dev/null
and output of perf to perf_data file.
How can I Do this ?
해결책
Actually you can put it in parenthesis. Following command has worked for me.
(perf stat -x, ../bin/sort data >/dev/null) 2>perfoutput.txt
다른 팁
The "perf" command has an option to redirect output to a file directly using -o option. In your case this will be
perf stat -o perfoutput.dat -x, ../bin/sort data >/dev/null
Depending on the way how perf
runs the program, simply quoting the arguments may be enough:
perf stat -x, '../bin/sort data >/dev/null' 2>perf_data