2>/dev/null and 2>&1

Remove those entries that have an error of “Permission Denied” :

find /opt -name dcm 2>/dev/null

Filter the output of a program and redirect the filtered result into a file:

./bin/programA -i ... -o ... 2>&1 | grep "keywords" > a.txt

Use xmgrace to plot a curve skipping the first row

Sometimes the file that is read by xmgrace has a header like below:

Ratio
0.67
0.52
...

If use xmgrace directly, we cannot plot the curve as expected.

I haven’t found the way of using xmgrace only. Instead, I only found how to specify columns using xmgrace.

With the help of other tools, here is a way to work around.

tail -n +2 a.txt | xmgrace -pipe

or

sed 1d a.txt | xmgrace -pipe