Friday, November 11, 2011

How to output the first line of each file in a directory


$ head -n 1 *


Sample output:
 $ head -n 1 *
==> Desktop <==

==> Development <==

==> Documents <==

==> Downloads <==

==> Dropbox <==

==> Environment <==

==> Library <==

==> Movies <==

==> Music <==

==> Pictures <==

==> Public <==

==> Sites <==

==> bin <==

==> current.html <==
Current IP CheckCurrent IP Address: 63.119.11.19

==> databases <==

==> my.cnf <==
[client]

(That's the directory structure of my home dir on my work machine.)
 

No comments: