LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-19-2008, 02:28 PM   #1
ErV
Senior Member
 
Registered: Mar 2007
Location: Russia
Distribution: Slackware 12.2
Posts: 1,202
Blog Entries: 3

Rep: Reputation: 62
Smile Total size of installed package - more elegant way to get it?


Hello.

I'd like to know how it is possible to get total file size of installed slackware package.
I discovered that it is possible to do this way:
Code:
du -sch `tail +8 /var/log/packages/opera-9.52-i386-1ErV |grep -v '.*/$'| sed 's/\(.*\)/\/\1/'`
But it is a bit ugly. Is there more elegant way to do this? (in one line of code, if possible).
 
Old 11-19-2008, 02:36 PM   #2
rg3
Member
 
Registered: Jul 2007
Distribution: Fedora
Posts: 527

Rep: Reputation: Disabled
One of these alternatives may be simpler:

Code:
awk '/^UNCOMPRESSED/ { print $4 * 1024; exit }' /var/log/packages/...
awk '/^UNCOMPRESSED/ { print $4,"K"; exit }' /var/log/packages/...
awk '/^UNCOMPRESSED/ { print $4 "K"; exit }' /var/log/packages/...
Edit: and way faster too, I suppose.

Last edited by rg3; 11-19-2008 at 02:38 PM.
 
Old 11-19-2008, 02:52 PM   #3
ErV
Senior Member
 
Registered: Mar 2007
Location: Russia
Distribution: Slackware 12.2
Posts: 1,202

Original Poster
Blog Entries: 3

Rep: Reputation: 62
Quote:
Originally Posted by rg3 View Post
One of these alternatives may be simpler:

Code:
awk '/^UNCOMPRESSED/ { print $4 * 1024; exit }' /var/log/packages/...
awk '/^UNCOMPRESSED/ { print $4,"K"; exit }' /var/log/packages/...
awk '/^UNCOMPRESSED/ { print $4 "K"; exit }' /var/log/packages/...
Edit: and way faster too, I suppose.
I must have been blind - uncompressed size is printed on 3rd line of file list for every package in /var/log/packages. Didn't notice it :-\.

Thanks for the info, question answered.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
BASH : Total directory size xgreen Programming 7 03-04-2013 05:33 AM
RPM package manager says package needs to be installed. But I already installed it! nick623 Linux - Software 2 05-24-2005 02:15 AM
Total partition size - User partition size is not equals to Free partition size navaneethanj Linux - General 5 06-14-2004 12:55 PM
Total File Size meshcurrent Linux - General 1 05-17-2004 02:09 PM
How Can I get the Total Size of a Dir w/o Recursing Into it? linuxSysProg Programming 3 08-08-2003 08:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration