How do I read the first line of a file using cat?

Doboy picture Doboy · May 24, 2011 · Viewed 214.2k times · Source

How do I read the first line of a file using cat?

Answer

Carl Norum picture Carl Norum · May 24, 2011

You don't need cat.

head -1 file

will work fine.