From owner-freebsd-questions@FreeBSD.ORG Fri Jan 18 23:26:54 2013 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5011D796 for ; Fri, 18 Jan 2013 23:26:54 +0000 (UTC) (envelope-from fbsd8@a1poweruser.com) Received: from mail-03.name-services.com (mail-03.name-services.com [69.64.155.195]) by mx1.freebsd.org (Postfix) with ESMTP id 36567DC7 for ; Fri, 18 Jan 2013 23:26:53 +0000 (UTC) Received: from [10.0.10.3] ([173.88.197.103]) by mail-03.name-services.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 18 Jan 2013 15:26:55 -0800 Message-ID: <50F9DA3E.5050607@a1poweruser.com> Date: Fri, 18 Jan 2013 18:26:54 -0500 From: Fbsd8 User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: FreeBSD questions Subject: sh script code to get file size. Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 18 Jan 2013 23:26:55.0119 (UTC) FILETIME=[4D86B1F0:01CDF5D3] X-Sender: fbsd8@a1poweruser.com X-Authenticated-Sender: fbsd8@a1poweruser.com X-EchoSenderHash: [fbsd8]-[a1poweruser*com] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jan 2013 23:26:54 -0000 In a script in am working on I need to find out the allocated size of a sparse file. The only command that comes to mind is "ls -lh" The "du -h" command is not appropriate because it will show the occupied size and not the allocated size. I don't know how to parse out to the position in the output of that "ls -lh" command to pickup the file size value. Is there some other way to do this?