grep pattern filename /dev/null The /dev/null or null device is special file that discards the data written to it. So, the /dev/null is always an empty file. Another way to print the filename is using the ‘-H’ option. The grep command for this is grep -H pattern filename