From owner-freebsd-hackers Sat Dec 11 8:41:15 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by hub.freebsd.org (Postfix) with ESMTP id A3CBA14FB4 for ; Sat, 11 Dec 1999 08:41:13 -0800 (PST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.9.3/8.9.3) id KAA25758; Sat, 11 Dec 1999 10:41:07 -0600 (CST) (envelope-from dan) Date: Sat, 11 Dec 1999 10:41:06 -0600 From: Dan Nelson To: Michael Beckmann Cc: hackers@FreeBSD.ORG Subject: Re: large file aware utilities Message-ID: <19991211104106.B25422@dan.emsphone.com> References: <3851B5AE.2AA0D202@nikoma.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <3851B5AE.2AA0D202@nikoma.de>; from "Michael Beckmann" on Sat Dec 11 03:23:42 GMT 1999 X-OS: FreeBSD 4.0-CURRENT Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In the last episode (Dec 11), Michael Beckmann said: > Greetings, > > it appears that tail is not functioning properly with a file > 2 GB. > What can I do to tail such a file (actually to make it smaller than 2 > GB) ? It looks like 'tail' wants to mmap() the entire file when you ask for a standard (last ## lines) tail. If you ask for a particular number of *bytes* from the end, however, it simply seek()s to that offset and starts printing. So as a quick hack, you can do a "tail -c 10000000 file | tail", which will first grab the last 10 meg of the file in question, then print the last 10 lines from that. This bug has been reported as http://www.freebsd.org/cgi/query-pr.cgi?pr=14786 -- Dan Nelson dnelson@emsphone.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message