Linux , how can I inspect a tar GZ file

how can I see the properties in this GZ file I downloaded


I want to see the time date and any other info about it possible

what is the command to inspect a file ?
LVL 1
NAMEWITHELD12Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Zephyr ICTCloud ArchitectCommented:
To see what's in the gz file try this:
tar -tf filename.tar.gz

Open in new window


Shows the size and permissions, date:
ls -lh <filename>

Open in new window


Some more info like accessed time and such:
stat <filename>

Open in new window

Murugesan NagarajanShell_script Automation /bin/bash /bin/bash.exe /bin/ksh /bin/mksh.exe AIX C C++ CYGWIN_NT HP-UX Linux MINGW32 MINGW64 SunOS Windows_NTCommented:
1) Following code display file names and directory names.
/usr/bin/tar [b]-tf[/b] filename.tgz

Open in new window


2) Following code display file names, directory names along with the time last modified for each of them
/usr/bin/tar -[b]tvf [/b]filename.tgz

Open in new window


3) Following code display:
FileType_permission No_Of_Links username groupname lastModified_Date_Time filename.tgz
/bin/ls [b]-l[/b] filename.tgz

Open in new window

-l stands for long listing
-h stands for human readable

4) Following code display:
Last Access Date time
Last Modify Date time
Last Change Date time
Birth Date time
/usr/bin/stat filename.tgz

Open in new window


5) Example stat --help display all options when using -c option:
/usr/bin/stat --help 
/usr/bin/stat -c %w filename.tgz

Open in new window


6) Manual for commands:
man ls
man stat
man tar

Open in new window


7) Display tar file name without unzipping .tgz file
/usr/bin/gunzip -l filename.tgz

Open in new window


8) command to unzip .tgz file to get tar file alone.
/usr/bin/gunzip filename.tgz

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Murugesan NagarajanShell_script Automation /bin/bash /bin/bash.exe /bin/ksh /bin/mksh.exe AIX C C++ CYGWIN_NT HP-UX Linux MINGW32 MINGW64 SunOS Windows_NTCommented:
In given answers:
Replace_Codes_Like:
[b]-tf[/b]
With:
-tf

Open in new window



Since [b] and [/b] are html related.

Open in new window

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.