From unknown Thu Jul 10 19:41:32 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6511: df output difficult to parse Resent-From: Valerio Pachera Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 25 Jun 2010 16:00:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 6511 X-GNU-PR-Package: gnu coreutils X-GNU-PR-Keywords: To: 6511@debbugs.gnu.org X-Debbugs-Original-To: submit@debbugs.gnu.org Received: via spool by submit@debbugs.gnu.org id=B.12774815634751 (code B ref -1); Fri, 25 Jun 2010 16:00:04 +0000 Received: (at submit) by debbugs.gnu.org; 25 Jun 2010 15:59:23 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OSBJK-0001Ea-AK for submit@debbugs.gnu.org; Fri, 25 Jun 2010 11:59:22 -0400 Received: from mail-iw0-f172.google.com ([209.85.214.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OSB3v-000184-9r for submit@debbugs.gnu.org; Fri, 25 Jun 2010 11:43:27 -0400 Received: by iwn39 with SMTP id 39so417310iwn.3 for ; Fri, 25 Jun 2010 08:43:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=r2+vH3RWi7vFx6vRH51ELheMqYXOOyEGZRP7uYoXiPQ=; b=i/sDZ0v11Py1Z95sc+yTbVdYJf6gGF8LMOIanS5EcwOa1HF+b+ut4qpGKA2B+fu+73 lMth0bWqCZWYBbdMs4ayg6Lzn1EDlxeV9JoiueNS0CSVFqu0oH1plQ4PQRPc6D+fYsBH RyTLxXUt2gPK63cLwdH3Sm1UbMbCUTvRHiXO8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=Pwj7BAnX0IFRmR4dJenUzAuuN0RE/SPMLZe8Jb3xPUKh3lMAnQhAGTZC6XazhJOKPj nWcdQ0A/abcRzreBaa1M7cpiS479Gw2VS49C/WJmSdTQRS7SsQe+G6LruAJDEnUOb9+G 7abbG7b/hvmNkRHg6W7Qr2sr2XppLMnFb/AGE= MIME-Version: 1.0 Received: by 10.231.156.73 with SMTP id v9mr939721ibw.117.1277480602151; Fri, 25 Jun 2010 08:43:22 -0700 (PDT) Received: by 10.231.146.6 with HTTP; Fri, 25 Jun 2010 08:43:22 -0700 (PDT) Date: Fri, 25 Jun 2010 17:43:22 +0200 Message-ID: From: Valerio Pachera Content-Type: text/plain; charset=UTF-8 X-Spam-Score: 0.0 (/) X-Mailman-Approved-At: Fri, 25 Jun 2010 11:59:20 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.3 (-) Package: GNU coreutils Version: 8.5 Severity: wishlist Description: I'm trying to parse di output of df command to check how much free space is left on my disks. I need to check this by a script. The problem is that, when the device name is long, we get a new line in the output (see example below). It's difficult then have data relate with the device name or mount poiunt usign grep and awk. Proposed Solution: simply add an option to not wrap the output text. File system Dim. Usati Disp. Uso% Montato su /dev/mapper/VolGroup00-testing 9,2G 3,3G 5,5G 38% / tmpfs 1,5G 0 1,5G 0% /lib/init/rw udev 10M 224K 9,8M 3% /dev tmpfs 1,5G 12K 1,5G 1% /dev/shm /dev/mapper/VolGroup00-dati 120G 77G 38G 68% /mnt/dati /dev/mapper/VolGroup00-opt 5,0G 963M 3,8G 21% /opt /dev/mapper/VolGroup00-var 5,0G 974M 3,8G 21% /var fileserver:/pubblica 1,4T 579G 722G 45% /media/pubblica proxy:/mnt/dati/ftp 9,8G 7,3G 2,0G 79% /media/ftp /dev/sdb1 977M 852M 125M 88% /media/VALERIO ###### trying to extract used % ###### $ df -h /dev/mapper/VolGroup00-dati | awk '{print $4}' Usati 68% $ df -h /dev/sdb1 | awk '{print $4}' | tr -d % Usati 125M Ad you can see, the colum 4 is not the same (used% in the first case, Total space in the second). Thank you From unknown Thu Jul 10 19:41:32 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6511: df output difficult to parse Resent-From: Bob Proulx Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 25 Jun 2010 21:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6511 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Valerio Pachera Cc: 6511@debbugs.gnu.org Received: via spool by 6511-submit@debbugs.gnu.org id=B6511.127750020313051 (code B ref 6511); Fri, 25 Jun 2010 21:11:02 +0000 Received: (at 6511) by debbugs.gnu.org; 25 Jun 2010 21:10:03 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OSG9z-0003OS-EC for submit@debbugs.gnu.org; Fri, 25 Jun 2010 17:10:03 -0400 Received: from joseki.proulx.com ([216.17.153.58]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OSG9w-0003OE-RE for 6511@debbugs.gnu.org; Fri, 25 Jun 2010 17:10:01 -0400 Received: from dementia.proulx.com (dementia.proulx.com [192.168.230.115]) by joseki.proulx.com (Postfix) with ESMTP id 34EC4213BB; Fri, 25 Jun 2010 15:09:56 -0600 (MDT) Received: by dementia.proulx.com (Postfix, from userid 1000) id 212F13CC204; Fri, 25 Jun 2010 15:09:56 -0600 (MDT) Date: Fri, 25 Jun 2010 15:09:56 -0600 From: Bob Proulx Message-ID: <20100625210956.GA14390@dementia.proulx.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-Spam-Score: -1.1 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.4 (--) Valerio Pachera wrote: > I'm trying to parse di output of df command to check how much free > space is left on my disks. I need to check this by a script. The > problem is that, when the device name is long, we get a new line in > the output (see example below). It's difficult then have data > relate with the device name or mount poiunt usign grep and awk. Thank you for the report. That is a nuisance! > Proposed Solution: > simply add an option to not wrap the output text. Your request has been considered, found useful and a new option has been added to df to enable this format. Please use the -P option. That will put all of the output on one line. $ df -Ph /dev/mapper/VolGroup00-dati | awk '{print $4}' -P, --portability use the POSIX output format Please find this option already installed on your system. I am so glad that we could so quickly add this option for you! :-) Bob From unknown Thu Jul 10 19:41:32 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6511: df output difficult to parse Resent-From: Davide Brini Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 25 Jun 2010 21:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6511 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: bug-coreutils@gnu.org Cc: 6511@debbugs.gnu.org Received: via spool by submit@debbugs.gnu.org id=B.127750119013493 (code B ref -1); Fri, 25 Jun 2010 21:27:02 +0000 Received: (at submit) by debbugs.gnu.org; 25 Jun 2010 21:26:30 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OSGPt-0003Va-Fr for submit@debbugs.gnu.org; Fri, 25 Jun 2010 17:26:29 -0400 Received: from mail.gnu.org ([199.232.76.166] helo=mx10.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OSGPp-0003VT-EI for submit@debbugs.gnu.org; Fri, 25 Jun 2010 17:26:28 -0400 Received: from lists.gnu.org ([199.232.76.165]:42606) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1OSGPZ-0000nT-Od for submit@debbugs.gnu.org; Fri, 25 Jun 2010 17:26:09 -0400 Received: from [140.186.70.92] (port=54127 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OSGPW-0006W7-HR for bug-coreutils@gnu.org; Fri, 25 Jun 2010 17:26:08 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,T_RP_MATCHES_RCVD,T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OSGPT-0004bZ-JV for bug-coreutils@gnu.org; Fri, 25 Jun 2010 17:26:04 -0400 Received: from mailout-eu.gmx.com ([213.165.64.42]:40943) by eggs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1OSGPT-0004bA-8Y for bug-coreutils@gnu.org; Fri, 25 Jun 2010 17:26:03 -0400 Received: (qmail invoked by alias); 25 Jun 2010 21:26:00 -0000 Received: from hex.aaisp.net.uk (EHLO ppp.zz) [90.155.53.9] by mail.gmx.com (mp-eu002) with SMTP; 25 Jun 2010 23:26:00 +0200 X-Authenticated: #48875277 X-Provags-ID: V01U2FsdGVkX18995kq52E910d4bshT6c+/szkL13p9gXroLUubRB 3ZaJscx8Z9ftom From: Davide Brini Date: Fri, 25 Jun 2010 22:13:45 +0100 User-Agent: KMail/1.13.3 (Linux/2.6.32-gentoo-r10; KDE/4.4.4; x86_64; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201006252213.46158.dave_br@gmx.com> X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -5.2 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.3 (-----) On Friday 25 June 2010, Valerio Pachera wrote: > Package: GNU coreutils > Version: 8.5 > > Severity: wishlist > > Description: > I'm trying to parse di output of df command to check how much free > space is left on my disks. > I need to check this by a script. > The problem is that, when the device name is long, we get a new line > in the output (see example below). > It's difficult then have data relate with the device name or mount > poiunt usign grep and awk. > > Proposed Solution: > simply add an option to not wrap the output text. > > File system Dim. Usati Disp. Uso% Montato su > /dev/mapper/VolGroup00-testing > 9,2G 3,3G 5,5G 38% / > tmpfs 1,5G 0 1,5G 0% /lib/init/rw > udev 10M 224K 9,8M 3% /dev > tmpfs 1,5G 12K 1,5G 1% /dev/shm > /dev/mapper/VolGroup00-dati > 120G 77G 38G 68% /mnt/dati > /dev/mapper/VolGroup00-opt > 5,0G 963M 3,8G 21% /opt > /dev/mapper/VolGroup00-var > 5,0G 974M 3,8G 21% /var > fileserver:/pubblica 1,4T 579G 722G 45% /media/pubblica > proxy:/mnt/dati/ftp 9,8G 7,3G 2,0G 79% /media/ftp > /dev/sdb1 977M 852M 125M 88% /media/VALERIO > > > ###### trying to extract used % ###### > > $ df -h /dev/mapper/VolGroup00-dati | awk '{print $4}' > Usati > > 68% > > > $ df -h /dev/sdb1 | awk '{print $4}' | tr -d % > Usati > 125M > > > Ad you can see, the colum 4 is not the same (used% in the first case, > Total space in the second). Have a look at the -P option. -- D. From unknown Thu Jul 10 19:41:32 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Valerio Pachera Subject: bug#6511: closed (df no longer wraps lines) Message-ID: References: <4D8A8C3C.10403@draigBrady.com> X-Gnu-PR-Message: they-closed 6511 X-Gnu-PR-Package: coreutils Reply-To: 6511@debbugs.gnu.org Date: Thu, 24 Mar 2011 00:15:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1300925703-9130-1" This is a multi-part message in MIME format... ------------=_1300925703-9130-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #6511: df output difficult to parse which was filed against the coreutils package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 6511@debbugs.gnu.org. --=20 6511: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D6511 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1300925703-9130-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 6511-done) by debbugs.gnu.org; 24 Mar 2011 00:14:07 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q2YBj-0002M1-7x for submit@debbugs.gnu.org; Wed, 23 Mar 2011 20:14:07 -0400 Received: from mail1.slb.deg.dub.stisp.net ([84.203.253.98]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1Q2YBh-0002LO-1R for 6511-done@debbugs.gnu.org; Wed, 23 Mar 2011 20:14:05 -0400 Received: (qmail 34093 invoked from network); 24 Mar 2011 00:13:58 -0000 Received: from unknown (HELO ?192.168.2.25?) (84.203.137.218) by mail1.slb.deg.dub.stisp.net with SMTP; 24 Mar 2011 00:13:58 -0000 Message-ID: <4D8A8C3C.10403@draigBrady.com> Date: Thu, 24 Mar 2011 00:11:40 +0000 From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3 MIME-Version: 1.0 To: 7157-done@debbugs.gnu.org, 6511-done@debbugs.gnu.org Subject: df no longer wraps lines X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: 6511-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) Since I've just changed df to no longer split entries with long device names over two lines (since it now aligns columns consistently), I'm closing these. cheers, Pádraig ------------=_1300925703-9130-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 25 Jun 2010 15:59:23 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OSBJK-0001Ea-AK for submit@debbugs.gnu.org; Fri, 25 Jun 2010 11:59:22 -0400 Received: from mail-iw0-f172.google.com ([209.85.214.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OSB3v-000184-9r for submit@debbugs.gnu.org; Fri, 25 Jun 2010 11:43:27 -0400 Received: by iwn39 with SMTP id 39so417310iwn.3 for ; Fri, 25 Jun 2010 08:43:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=r2+vH3RWi7vFx6vRH51ELheMqYXOOyEGZRP7uYoXiPQ=; b=i/sDZ0v11Py1Z95sc+yTbVdYJf6gGF8LMOIanS5EcwOa1HF+b+ut4qpGKA2B+fu+73 lMth0bWqCZWYBbdMs4ayg6Lzn1EDlxeV9JoiueNS0CSVFqu0oH1plQ4PQRPc6D+fYsBH RyTLxXUt2gPK63cLwdH3Sm1UbMbCUTvRHiXO8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=Pwj7BAnX0IFRmR4dJenUzAuuN0RE/SPMLZe8Jb3xPUKh3lMAnQhAGTZC6XazhJOKPj nWcdQ0A/abcRzreBaa1M7cpiS479Gw2VS49C/WJmSdTQRS7SsQe+G6LruAJDEnUOb9+G 7abbG7b/hvmNkRHg6W7Qr2sr2XppLMnFb/AGE= MIME-Version: 1.0 Received: by 10.231.156.73 with SMTP id v9mr939721ibw.117.1277480602151; Fri, 25 Jun 2010 08:43:22 -0700 (PDT) Received: by 10.231.146.6 with HTTP; Fri, 25 Jun 2010 08:43:22 -0700 (PDT) Date: Fri, 25 Jun 2010 17:43:22 +0200 Message-ID: Subject: df output difficult to parse From: Valerio Pachera To: submit@debbugs.gnu.org Content-Type: text/plain; charset=UTF-8 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Fri, 25 Jun 2010 11:59:20 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.3 (-) Package: GNU coreutils Version: 8.5 Severity: wishlist Description: I'm trying to parse di output of df command to check how much free space is left on my disks. I need to check this by a script. The problem is that, when the device name is long, we get a new line in the output (see example below). It's difficult then have data relate with the device name or mount poiunt usign grep and awk. Proposed Solution: simply add an option to not wrap the output text. File system Dim. Usati Disp. Uso% Montato su /dev/mapper/VolGroup00-testing 9,2G 3,3G 5,5G 38% / tmpfs 1,5G 0 1,5G 0% /lib/init/rw udev 10M 224K 9,8M 3% /dev tmpfs 1,5G 12K 1,5G 1% /dev/shm /dev/mapper/VolGroup00-dati 120G 77G 38G 68% /mnt/dati /dev/mapper/VolGroup00-opt 5,0G 963M 3,8G 21% /opt /dev/mapper/VolGroup00-var 5,0G 974M 3,8G 21% /var fileserver:/pubblica 1,4T 579G 722G 45% /media/pubblica proxy:/mnt/dati/ftp 9,8G 7,3G 2,0G 79% /media/ftp /dev/sdb1 977M 852M 125M 88% /media/VALERIO ###### trying to extract used % ###### $ df -h /dev/mapper/VolGroup00-dati | awk '{print $4}' Usati 68% $ df -h /dev/sdb1 | awk '{print $4}' | tr -d % Usati 125M Ad you can see, the colum 4 is not the same (used% in the first case, Total space in the second). Thank you ------------=_1300925703-9130-1--