How Do You Examine an .xz File in the /var/log Directory (with No “tar” in Its Extension)?

Problem scenario
You have an mail.xz file in /var/log/ that has nor "tar" in its name. You want to view its contents. What do you do to view or use an .xz file with no "tar" in its name?

If you are new at this, copy the log to the /tmp/ directory (assuming this .xz file has no sensitive data or no one else uses this server). Then run these commands (where logfilename is the name of the file you want to view without its ".xz" extension):

cd /tmp/
mkdir delete
mv logfilename.xz delete
cd delete
sudo xz --decompress logfilename.xz
sudo view logfilename

Leave a comment

Your email address will not be published. Required fields are marked *