LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-23-2009, 01:27 AM   #1
Berris.Oliver
LQ Newbie
 
Registered: Feb 2009
Posts: 16

Rep: Reputation: 0
Saving the total bytes written using TAR to a textfile


The TAR command in Linux has an option to display the total bytes written after creating an archive by adding --totals. No problem with using it like the syntax stated below:

tar -cvf mp3.tar mp3 --totals

But how can you save the total bytes in a textfile? I tried this syntax but it didn't work as expected:

tar -cvf mp3.tar mp3 --totals > test.txt

Is there a command that offers more convenience or an easier way just to get the tarred file size information?
 
Old 02-23-2009, 01:32 AM   #2
indeliblestamp
Member
 
Registered: Feb 2006
Distribution: Fedora
Posts: 341
Blog Entries: 3

Rep: Reputation: 40
This should work for you:
Code:
tar -cvf mp3.tar mp3 --totals 2> test.txt
 
Old 02-24-2009, 02:25 AM   #3
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 676

Rep: Reputation: 137Reputation: 137
Code:
stat -c '%s' mp3.tar
 
  


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
error "tar (child): /dev/st0: Wrote only 0 of 10240 bytes? hocheetiong Linux - Newbie 3 02-03-2008 05:25 PM
BackUp & Restore with TAR (.tar / .tar.gz / .tar.bz2 / tar.Z) asgarcymed Linux - General 5 12-31-2006 02:53 AM
tar count archive total matsko Linux - Software 1 01-04-2006 05:14 PM
SQL question - total bytes per month ganninu Programming 7 01-06-2004 10:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:32 PM.

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