Tuesday, June 1, 2021

Reading.bz2 zip file

 How to read bz2 zip file


# bzcat yourfile.log.bz2 | grep -i <string> | more

# bzcat /var/log/messages.2021.02.20.bz2

# bzgrep Archive $(hostname -s)-audit.log.2021.05.2*.bz2

# bxgrep -c fuser myhost-audit.log.2021.05.2*.bz2

# bzip2 -d myhost-audit.log.2021.05.2*.bz2

 

To uncompress

# bunzip2 myhost-audit.log.2021.05.2*.bz2

$ (hostname -s)-secure.20210520.bz2 | grep -E "Starting session.*file_upload" | cut -d' ' -f2 | sort | uniq -c

 

No comments:

Post a Comment

Git branch show detached HEAD

  Git branch show detached HEAD 1. List your branch $ git branch * (HEAD detached at f219e03)   00 2. Run re-set hard $ git reset --hard 3. ...