opposite to tail

opposite to tail

Post by Daniel N » Tue, 04 Dec 2001 00:11:51



tail print the last part of input.
How do you print the first part, say first 10 lines?

Daniel

 
 
 

opposite to tail

Post by Michael Heimin » Tue, 04 Dec 2001 00:28:51



16:11:

Quote:> tail print the last part of input.
> How do you print the first part, say first 10 lines?

'man head'

Michael Heiming

 
 
 

opposite to tail

Post by Kade » Tue, 04 Dec 2001 01:44:08




> 16:11:
>> tail print the last part of input.
>> How do you print the first part, say first 10 lines?
> 'man head'

As in, 'remove head(1) from tail(1)'

heh.. Sorry, couldn't resist.

 
 
 

opposite to tail

Post by Gareth William » Tue, 04 Dec 2001 01:37:38




> tail print the last part of input.
> How do you print the first part, say first 10 lines?

        head -n10 <filename>

--
Kind Regards,

Gareth Williams

 
 
 

opposite to tail

Post by Daniel N » Tue, 04 Dec 2001 04:37:00




> 16:11:

> > tail print the last part of input.
> > How do you print the first part, say first 10 lines?
> 'man head'

> Michael Heiming

thanks,
 
 
 

opposite to tail

Post by b.. » Tue, 04 Dec 2001 10:49:16



> tail print the last part of input.
> How do you print the first part, say first 10 lines?

  One of the more important parts of a man page is at the bottom:

     "See also:"

  This is one of the best ways to locate related commands.

--

Bill 'shortsig' Hassell, HP Remote Engineering Services

 
 
 

1. hairy tail (was Re: tail -f & RAM disk device driver wanted)

-----BEGIN PGP SIGNED MESSAGE-----

Gawain> I have successfully implemented tail -f functionality by
Gawain> detecting file size changes using stat().  If the file size
Gawain> has changed I do whatever I want to do, if it has not changed
Gawain> I just sleep(1).

Gawain> This actually works quite well and is not CPU intensive at all
Gawain> - in fact it seems LESS CPU intensive then whatever "tail -f"
Gawain> is doing!!

Martin> That is all fine and dandy, but you can only read from regular
Martin> files (or maybe pipes as well?) that way. Try to read from a
Martin> character device, and you loose[sic]. (I think that this can make
Martin> quite a lot of sense at times.)

Well the solution is a "hairy" tail (hmm ;-) which checks whether it
is an ordinary file or a device at the start, and has a read-loop of
each type.

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2i
Comment: Processed by Mailcrypt 3.4, an Emacs/PGP interface

iQB1AwUBMUbAmedsuUurvcRtAQE6gwMAv+wD6OKTUi3eJjeBqaUxIC/s088z0YDX
Urcbt86L5aRqgmPz8PUqU+59kVkQgEIKp9MI3NzavrgsIF5iX2o0t8R2snpu4G4E
G9roeaMW8u6T03yi+46DdeNEvw62FUq4
=hZjq
-----END PGP SIGNATURE-----
--

APM Ltd., Poseidon House, Castle Park, Cambridge CB3 0RD

2. PAO installed, need mouse help

3. non-static buffer tail (was Re: `tail' limitation)

4. config options for USB

5. "tail" stops tailing?

6. Can't compile tclX7.4

7. Opposite of baseline

8. Supermount (NOT Mandrake!)

9. file mapping of memory (opposite of mmap())

10. can internet gateway be on opposite side of a tunnel?

11. Is there a program the opposite of rawrite

12. Could term run in the opposite way?

13. opposite of disown