Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 02-23-2009, 02:27 AM   #1
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, 02:32 AM   #2
Registered: Feb 2006
Distribution: Fedora
Posts: 341
Blog Entries: 3

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

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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 06:25 PM
BackUp & Restore with TAR (.tar / .tar.gz / .tar.bz2 / tar.Z) asgarcymed Linux - General 5 12-31-2006 03:53 AM
tar count archive total matsko Linux - Software 1 01-04-2006 06:14 PM
SQL question - total bytes per month ganninu Programming 7 01-06-2004 11:46 AM > Forums > Linux Forums > Linux - Newbie

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

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