Back
Close

Computing with Data

elgeish
179.8K views

Compression in Linux

echo "Call me Ishmael.
Some years ago—never mind how long precisely—
having little or no money in my purse," > mobyDick.txt
cat mobyDick.txt | head -n 1 # first line
bzip2 -v mobyDick.txt # compress .txt to .txt.bz2
# first line of compressed file
cat mobyDick.txt.bz2 | head -n 1
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io
codingame x discord
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants