head – output the first part of files


commandline session

$sudo head /var/log/syslog
Jan  5 20:10:05 debian syslogd 1.5.0#6.1: restart.
Jan  5 20:10:05 debian anacron[1056]: Job `cron.daily' terminated
Jan  5 20:10:05 debian anacron[1056]: Normal exit (1 job run)
Jan  5 20:12:14 debian acpid: client connected from 1055[0:0]
Jan  5 20:12:14 debian acpid: 1 client rule loaded
Jan  5 20:12:14 debian acpid: client connected from 1055[0:0]
Jan  5 20:12:14 debian acpid: 1 client rule loaded
Jan  5 20:13:03 debian acpid: client 1055[0:0] has disconnected
Jan  5 20:13:03 debian acpid: client 1055[0:0] has disconnected
Jan  5 20:14:54 debian /usr/sbin/gpm[1239]: *** info [daemon/processrequest.c(42)]:
$sudo head -n 5 /var/log/syslog
Jan  5 20:10:05 debian syslogd 1.5.0#6.1: restart.
Jan  5 20:10:05 debian anacron[1056]: Job `cron.daily' terminated
Jan  5 20:10:05 debian anacron[1056]: Normal exit (1 job run)
Jan  5 20:12:14 debian acpid: client connected from 1055[0:0]
Jan  5 20:12:14 debian acpid: 1 client rule loaded
$sudo head -n 0  /var/log/syslog
$sudo head -n 1  /var/log/syslog
Jan  5 20:10:05 debian syslogd 1.5.0#6.1: restart.
$

Print the first 10 lines of each FILE to standard output.
Part of debian coreutils.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: