From owner-freebsd-questions@FreeBSD.ORG Sat Jan 19 03:34:07 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 884BED5F for ; Sat, 19 Jan 2013 03:34:07 +0000 (UTC) (envelope-from bonomi@mail.r-bonomi.com) Received: from mail.r-bonomi.com (mx-out.r-bonomi.com [204.87.227.120]) by mx1.freebsd.org (Postfix) with ESMTP id 369C787D for ; Sat, 19 Jan 2013 03:34:06 +0000 (UTC) Received: (from bonomi@localhost) by mail.r-bonomi.com (8.14.4/rdb1) id r0J3bPZE090828; Fri, 18 Jan 2013 21:37:25 -0600 (CST) Date: Fri, 18 Jan 2013 21:37:25 -0600 (CST) From: Robert Bonomi Message-Id: <201301190337.r0J3bPZE090828@mail.r-bonomi.com> To: fbsd8@a1poweruser.com, questions@freebsd.org Subject: Re: sh script code to get file size. In-Reply-To: <50F9DA3E.5050607@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: Sat, 19 Jan 2013 03:34:07 -0000 > From owner-freebsd-questions@freebsd.org Fri Jan 18 17:30:31 2013 > Date: Fri, 18 Jan 2013 18:26:54 -0500 > From: Fbsd8 > To: FreeBSD questions > Subject: sh script code to get file size. > > 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. ls -lh procmail.log |awk '{print $5}'