ps needs to be used with ps -w argument to be able to work with GREP or multiple GREPs 1. ps | grep xxx | grep -q yyyy > testfile.txt; Writes nothing to file 2. ps -w | grep xxx | grep -q yyyy > testfile.txt; Writes expected output to file I do see empty file instead expected output if -w argument is NOT used Platform: Linux asus 2.6.22.19 #2 BusyBox v1.22.1 (2014-05-29 02:51:54 MSK) multi-call binary.