How Do I Gzip a Log File in Linux?
Contents How Do I Gzip a Log in Linux? Gzip All the Files Change the Directory to Audit Logs as Follows: # Cd /Var/Log/Audit. Execute the Following Command in...
Contents
How do I gzip a log in Linux?
gzip all the files
- Change the directory to audit logs as follows: # cd /var/log/audit.
- Execute the following command in the audit directory: # pwd /var/log/audit. …
- This will zip all the files in audit directory. Verify the gzipped log file in the /var/log/audit directory:
How do I zip a log file in Linux?
Both Linux and UNIX include various commands for Compressing and decompresses (read as expand compressed file). To compress files you can use gzip, bzip2 and zip commands. To expand compressed file (decompresses) you can use and gzip -d, bunzip2 (bzip2 -d), unzip commands.