Skip to content
tech.tutulutu.ee
Simple Blog about Tech – written for myself. Use with caution.
  • Home
  • Links
command-line

Compress or extract directory using tar command

Posted December 11, 2025 , Updated April 24, 2026
tar -czvf name-of-archive.tar.gz /path/to/directory-or-file/

or in current folder:

tar -czvf name-of-archive.tar.gz .
tar -xzvf archive.tar.gz -C /tmp

If you have file like backup.sql.gz, extract it:

gzip -d backup.sql.gz

Thanks to: https://www.howtogeek.com/248780/how-to-compress-and-extract-files-using-the-tar-command-on-linux/

command line

Post navigation

Older post
Overwrite disk with zeros
Newer post
PHP – show defined variables

Recent Posts

  • What takes room in my linux machine
  • PHP ternary logic
  • PHP – find out if variable is set
  • compose.yaml
  • Flush DNS in computer

Categories

  • Angularjs
  • apache
  • Atom
  • aws
  • bootstrap
  • command-line
  • css
  • docker
  • firefox
  • Git
  • gmail
  • https
  • Java
  • jQuery
  • LAN
  • laravel
  • linux
  • music
  • MySQL
  • network
  • nginx
  • nodejs
  • npm
  • php
  • phpunit
  • printers
  • Python
  • Sailsjs
  • sql
  • ssh
  • SSL and HTTPS
  • thunderbird
  • Uncategorized
  • vim
  • web
  • woocommerce
  • wordpress

Tags

add user angularjs apache atom aws bootstrap browser command line composer css dns docker dpkg find find file firefox gedit htaccess html htpasswd https install soft ip java laravel linux music mysql network nginx npm php phpunit port proxy rsync s3cmd scp server ssh thunderbird ubuntu visudo woocommerce wordpress
© 2026 tech.tutulutu.ee
Powered by WordPress | Theme: Graphy by Themegraphy