perl -e ' open(FILE, '<','/tmp/Config1'); while(){ print if /9344151299/i }; close FILE; ' # Or perl -ne 'print if /9344151299/i' /tmp/Config1