how to check the size of a tar file in linux

Ads
 

how to check the size of a tar file in linux

Hi,

I want to check the size of tar file in Linux. How to check the size of a tar file in linux?

What Linux command I should use to check the size of a tar file?

Thanks

View Answers

April 22, 2020 at 4:03 PM

Hi,

If you want to check the size of tar.gz file then you can use the ls command:

ls -l myfile.tar.gz

This will give you the size of file.

But If you want to check the actual size of the files stored in the tar.gz file then you can use following command:

gzip -l mydata.tar.gz

This command will give following output:

[email protected]:~/examples$ gzip -l mydata.tar.gz
         compressed        uncompressed  ratio uncompressed_name
                492               10240  95.4% mydata.tar

Here is the screen shot:

Hope this helps you.

Thanks


April 22, 2020 at 4:04 PM

Hi,

Check the following tutorial for more examples:

Thanks


April 23, 2020 at 8:16 AM

Hi,

Following command gives the file size in bytes:

tar -xzf mydata.tar.gz --to-stdout|wc -c

Thanks

Ads









Related Tutorials/Questions & Answers:
how to check the size of a tar file in linux
how to check the size of a tar file in linux  Hi, I want to check the size of tar file in Linux. How to check the size of a tar file in linux? What Linux command I should use to check the size of a tar file? Thanks
How do I compress a tar file in Linux
How do I compress a tar file in Linux  Hi, I want to create the tar.gz file file of a directory in Linux. My directory contains many sub directories... for creating tar of directory and all the contents inside it. the created tar file should
Advertisements
How do I compress a tar file in Linux
How do I compress a tar file in Linux  Hi, I want to create the tar.gz file file of a directory in Linux. My directory contains many sub directories... for creating tar of directory and all the contents inside it. the created tar file should
How do I compress a tar file in Linux
How do I compress a tar file in Linux  Hi, I want to create the tar.gz file file of a directory in Linux. My directory contains many sub directories... for creating tar of directory and all the contents inside it. the created tar file should
how to create tar file in ubuntu
how to create tar file in ubuntu  Hi, I have a directory with many sub directories and files in it. I want to create tar file of the directory so... tar file in ubuntu? Thanks   Hi, Here is command to create tar file
how to create tar file in ubuntu
how to create tar file in ubuntu  Hi, I have a directory with many sub directories and files in it. I want to create tar file of the directory so... tar file in ubuntu? Thanks   Hi, Here is command to create tar file
linux tar folder and subfolders
for me for zipping it into a file possible Linux tar file. I just searched and found...linux tar folder and subfolders  Hi, I am new to Linux operating.... Help me with the command in Linux for archiving folder and subfolders into tar
How to Increase Upload File Size Limit in php
How to Increase Upload File Size Limit in php  Increase Upload File... can also check it: http://www.phpzag.com/php-increase-upload-file-size-limit.... But the default file upload size settings restrict you to upload large files. PHP
How a split a file into many based on size?
How a split a file into many based on size?  Consider a text file which has a size of 400 bytes, i need to split up the contents in that 400 bytes file into 100 bytes of separate files.So there should be totally 4 files should
Create tar.gz file in Linux command line
How to create tar.gz file in Linux? In this tutorial I will show you how... directory name or file name for adding into the tar.gz file. Linux tar command - How to create a tar.gz file in Linux to archive a directory and all
track file size changes
track file size changes  How to track a change in file size
How to create a zip file and how to compare zip size with normal text file
How to create a zip file and how to compare zip size with normal text file  Hi, how are you?I hope you are fine.I want program like how to create zip.../ZipCreateExample.shtml but when i verified the size of zip and normal file,normal file is showing
How to delete content of a log file from linux terminal?
How to delete content of a log file from linux terminal?  Hi, My production server is on the linux machine. I am trying to debug and find the slow...-queries.log file. Can anyone tell me how to do this? Thanks   Hi, Its
How to check if a file is read-only in java
How to check if a file is read-only in java A read-only file is any file... will not be able to make changes to it. You can make a file read-only by using setReadOnly() method and can check this using canWrite() method of File class
How to Check Markup in PHP File from Command Line
How to Check Markup in PHP File from Command Line  Check Markup in PHP File from Command Line   PHP has a feature that allowed you to check... try this: http://www.phpzag.com/check-markup-in-php-file-from-command-line
tar command
tar command  Hi, What is tar command in Linux and how it is used? Thanks
How to put text file numbers to array and check the position of numbers?
How to put text file numbers to array and check the position of numbers?   I have numbers in text file data.txt 12 9 8 3 1
tar directory and subdirectories
on Linux machine. I have to create the .tar file of a directory and subdirectories. How I can tar directory and subdirectories? Thanks   Hi, It's very easy in Linux or Unix. You can easily create tar archive of directory
How do I tar a directory without retaining the directory structure?
How do I tar a directory without retaining the directory structure?  Hi, I want to create tar file without retaining the directory permission. How to do this? Thanks   Use tar czf ~/backup.tgz Thanks
How do I tar a directory without retaining the directory structure?
How do I tar a directory without retaining the directory structure?  Hi, I want to create tar file without retaining the directory permission. How to do this? Thanks   Use tar czf ~/backup.tgz Thanks
ModuleNotFoundError: No module named 'page-size-check'
named 'page-size-check' How to remove the ModuleNotFoundError: No module named 'page-size-check' error? Thanks   Hi, In your python...ModuleNotFoundError: No module named 'page-size-check'  Hi, My
How to Unrar in Linux?
How to Unrar in Linux?  Hi, How to Unrar Files in Linux? Thanks   Hi, First install unrar tool on your linux box. Use the following...-complete-transaction first to finish them. --> Running transaction check
what is etc profile file in Linux
the /etc/profile file in Linux. What is the use of /etc/profile file? Thanks   Hi, The profile file: /etc/profile Is very import file in Linux..., check one real example at: how to install anaconda in ubuntu for all users
ModuleNotFoundError: No module named 'odoo10-addon-mail-check-mailbox-size'
: ModuleNotFoundError: No module named 'odoo10-addon-mail-check-mailbox-size' How...ModuleNotFoundError: No module named 'odoo10-addon-mail-check-mailbox-size...-size python with following command: pip install odoo10-addon-mail-check
ModuleNotFoundError: No module named 'odoo12-addon-mail-check-mailbox-size'
: ModuleNotFoundError: No module named 'odoo12-addon-mail-check-mailbox-size' How...ModuleNotFoundError: No module named 'odoo12-addon-mail-check-mailbox-size...-size python with following command: pip install odoo12-addon-mail-check
ModuleNotFoundError: No module named 'odoo12-addon-mail-check-mailbox-size'
: ModuleNotFoundError: No module named 'odoo12-addon-mail-check-mailbox-size' How...ModuleNotFoundError: No module named 'odoo12-addon-mail-check-mailbox-size...-size python with following command: pip install odoo12-addon-mail-check
Deploying website war file on linux
Deploying website war file on linux  I have BOLLYWOOD_MIRROR.war file.I want to host it on linux server on path. After deployment of war file its... guidance of hosting war file on linux Thank you
how to set size of button,textfield.
how to set size of button,textfield.  how we set size of button... large how to set as a preferd size in the panel or frame .when we click maximize button not effect on text or button to their of size the set on the prefered
How to find hashtable size in Java?
How to find hashtable size in Java?  Hi, What is the code for Hashtable in Java? How to find hashtable size in Java? Give me the easy code. Thanks
How to decrease image thumbnail size in java?
How to decrease image thumbnail size in java?  Hi, I my web application I have to create the thumbnail size image from the image file uploaded by user. How to decrease image thumbnail size in java? Thanks
Difference in size of .java & its respective .class file
Difference in size of .java & its respective .class file  Hai, I had created & compiled a java class named sample.java. The size of sample.java is 340KB. Whereas the size of its respective class file sample.class is 137KB

Ads