untaring files in a redhat sos report

I am hoping to untar individual files in an sos report
/var/log/messages
/etc/ssh/ssdh.conf


you get the idea


if you have not done it, it is not an easy question.  the format inside of an sos report is not pretty


redhat 5/6
TIMFOX123Asked:
Who is Participating?
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.

Seth SimmonsSr. Systems AdministratorCommented:
move the sos report file to an empty folder and extract
tar xJf <filename>
0
TIMFOX123Author Commented:
I was actually looking to save the space.  Most new servers are virtual and live on a small amount of san.   comparing many servers this way is not practical
0
TintinCommented:
do

tar xvf /path/to/file.tar -C /dir/to/extract/to /var/log/messages
0

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
Seth SimmonsSr. Systems AdministratorCommented:
file is compressed; need to use xJvf with tar

you would need to know the top level folder name that sosreport creates then from there you will find /var/log/messages; you can change the output directory where the report is created but not the file name

to find what name it uses, you can do tar tf <filename> | head -n 1 then take that top level folder and use that when extracting

you can also use that method to create a script if you have many you need to extract just a few files
0
MazdajaiCommented:
tar -xvf sosreport.tar.xz --wildcards *var/log/messages
tar -xvf sosreport.tar.xz --wildcards *etc/ssh/ssdh.conf

Open in new window

0
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.