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

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:

deepak@deepak-VirtualBox:~/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









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
How to adjust a size of a pdf file
How to adjust a size of a pdf file       In this program we are going to tell you how we can adjust the size of a pdf file irrespective of the fact whether it exists
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
tar command
tar command  Hi, What is tar command in Linux and how it is used? Thanks
track file size changes
track file size changes  How to track a change in file size
How to check a file is hidden or not in java
Description: This example demonstrate how to check a file is hidden at a given path or not.  The method isHidden() of the File class check for its hidden property of a file. As in the file path we see '\' (backslash
How to check a file exists or not in java.
Description: This example demonstrate how to check a file exits at a given path or not.  The method isFile() of the File class check for its existence. As in the file path we see '\' (backslash) that is used to denote
Java file get size
Java file get size In this section, you will learn how to get the size... then calls the method length() which returns the size of the file in bytes. Then we have converted the size of file from bytes to kilo bytes. Here is the code
How to extract a zip file to a folder in Linux?
How to extract a zip file to a folder in Linux? Step by step command... use this command to extract a zip file. This tutorial will explain you how... to use the unzip tool to zip a file. Related Linux tutorials
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
file size - JSP-Servlet
_upload/Sinle_upload.xhtml.shtml. But, this jsp action file will not check the file size. Anyone help me how to check the file size with this coding. I tried...file size  Hello friends, I got the file upload
Getting the Size of a File in Java
Java file get size In this section, you will learn how to get the size... then calls the method length() which returns the size of the file in bytes. Then we have converted the size of file from bytes to kilo bytes.ADS_TO_REPLACE_1 Here
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
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 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 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
Java MappedByteBuffer example, How to create a large size file in java.
Java MappedByteBuffer example, How to create a large file in java. In this tutorial, you will see how to create a large file with the help...;} } Output C:\>java CreateFile File
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... setReadOnly() method and can check this using canWrite() method of File class... to check read only file: Java API provides the functions to find if any file
unzip file in LInux
unzip file in LInux  Hi, I am working on a Linux project and we have to extract large number of zip files. I don't have the desktop access... to unzip a zip file into a directory. How I can do this? Thanks
unzip file in LInux
unzip file in LInux  Hi, I am working on a Linux project and we have to extract large number of zip files. I don't have the desktop access... to unzip a zip file into a directory. How I can do this? Thanks
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
What is the maximum size of a file that can be uploaded using PHP and how can we change this?
What is the maximum size of a file that can be uploaded using PHP and how can we change this?  What is the maximum size of a file that can be uploaded using PHP and how can we change
limiting file size - JSP-Servlet
limiting file size  I 'am unable to limit the size of file usin jspx.Can some body guide me ? Thanks
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
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
Limiting the Size of a Log File in Java
Limiting the Size of a Log File in Java  ... to limit the size of a log file in Java. Log files haven't any boundation at the file creation time but Java provides the facility for limiting the size of a log
limiting file size - JSP-Servlet
limiting file size  I 'am unable to limit the size of file using... uploadMaxFileSize 100m Set the size limit... 100k Set the threshold size - files
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
File size limit - JSP-Servlet
File size limit  i am still facing same issue. After adding parameter in web.xml web application is giving error.here is my web.xml file... /WEB-INF/tlds/c.tld   Hi friend, To set the file
Getting file size - JSP-Servlet
Getting file size  Hello friends, I am doing a jsp project. File uploading is one part of that. When uploading i have to check the file size. For this i used the java method .length(). But, for all type of files
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
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
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
Java check end of file
Java check end of file In this section, you will learn how to check that the file has been read till the end of file. Data has been read one by one from the file. The loop is used to continually read the file until there are no more
org.apache.jackrabbit - oak-segment-tar version 1.8.10 Maven dependency. How to use oak-segment-tar version 1.8.10 in pom.xml?
org.apache.jackrabbit  - Version 1.8.10 of oak-segment-tar Maven dependency? How to use  org.apache.jackrabbit  - Version 1.8.10 of oak-segment-tar in pom.xml? How to use oak-segment-tar version 1.8.10 in pom.xml? Learn
org.apache.jackrabbit - oak-segment-tar version 1.9.7 Maven dependency. How to use oak-segment-tar version 1.9.7 in pom.xml?
org.apache.jackrabbit  - Version 1.9.7 of oak-segment-tar Maven dependency? How to use  org.apache.jackrabbit  - Version 1.9.7 of oak-segment-tar in pom.xml? How to use oak-segment-tar version 1.9.7 in pom.xml? Learn
org.apache.jackrabbit - oak-segment-tar version 1.6.11 Maven dependency. How to use oak-segment-tar version 1.6.11 in pom.xml?
org.apache.jackrabbit  - Version 1.6.11 of oak-segment-tar Maven dependency? How to use  org.apache.jackrabbit  - Version 1.6.11 of oak-segment-tar in pom.xml? How to use oak-segment-tar version 1.6.11 in pom.xml? Learn
org.apache.jackrabbit - oak-segment-tar version 1.9.11 Maven dependency. How to use oak-segment-tar version 1.9.11 in pom.xml?
org.apache.jackrabbit  - Version 1.9.11 of oak-segment-tar Maven dependency? How to use  org.apache.jackrabbit  - Version 1.9.11 of oak-segment-tar in pom.xml? How to use oak-segment-tar version 1.9.11 in pom.xml? Learn
org.apache.jackrabbit - oak-segment-tar version 1.8.9 Maven dependency. How to use oak-segment-tar version 1.8.9 in pom.xml?
org.apache.jackrabbit  - Version 1.8.9 of oak-segment-tar Maven dependency? How to use  org.apache.jackrabbit  - Version 1.8.9 of oak-segment-tar in pom.xml? How to use oak-segment-tar version 1.8.9 in pom.xml? Learn

Ads