Cheat Sheet
The commands you keep forgetting, with a one-line description and a real example you can copy - 384 across 26 tools. Pick a tool in the sidebar, or search across all of them.
tar & Compression
Create and extract archives, and zip / unzip files.| Command | What it does | Example |
|---|---|---|
mnemonic | c=create, x=extract, t=list, z=gzip, f=file. | czf = Create Zip File |
tar -czf | Create a gzip-compressed archive. | tar -czf site.tar.gz public/ |
tar -xzf | Extract a gzip archive. | tar -xzf site.tar.gz |
tar -xzf -C | Extract into a target folder. | tar -xzf site.tar.gz -C /var/www |
tar -tzf | List an archive’s contents. | tar -tzf site.tar.gz |
tar --exclude | Skip paths while archiving. | tar -czf app.tar.gz app/ --exclude='*.log' |
gzip | Compress a single file in place. | gzip big.log |
gunzip | Decompress a .gz file. | gunzip big.log.gz |
zip -r | Make a cross-platform .zip. | zip -r site.zip public/ |
unzip | Extract a .zip. | unzip site.zip |
unzip -d | Extract a .zip into a folder. | unzip site.zip -d ./out |