How to Archive Folders in Linux (tar and gzip tutorial) - Linux Crash Course Series

Ғылым және технология

In the Linux Crash Course series, we'll go over one important foundational Linux topic each episode. This series includes tutorials, demonstrations, and more! In this episode, Jay will go over the basics of archiving folders on Linux systems. More specifically, examples of the tar and gzip commands are shown.
Thank you so much to Linode for sponsoring the Linux Crash Course series!
Check them out and spin up your very own Linux server in less than two minutes ➜ learnlinux.link/akamai
Brand New Udemy Courses Available!
Check out my new courses on Udemy and take your learning even further!
• Ansible Course ➜ learnlinux.link/ansible
• Linux Essentials Course ➜ learnlinux.link/linux-essentials
Check out the Linux Shop
In the official shop, you'll find Shirts, hats, stickers, bags and more!
➜ merch.learnlinux.tv
5% discount on LPI exam vouchers
After you finish Jay's new course, get 5% off an LPI exam voucher here:
➜ learnlinux.link/lpi-voucher
Become a Patron
Show your support for Learn Linux TV on Patreon and get access to exclusive perks!
➜ learnlinux.link/patron
Become a Channel Member
Show your support for Learn Linux TV here on KZread and get access to exclusive perks!
➜ learnlinux.link/member
Mastering Ubuntu Server: 4th Edition
Jay's latest book covers everything you need to know in order to master Ubuntu Server. It's available here:
➜ ubuntuserverbook.com
Linux Gear and Kits
Check out Jay's choice of hardware products, audio/video equipment, and more.
➜ learnlinux.link/amazon
Grab an awesome Pi-powered KVM
Support Learn Linux TV and grab yourself a TinyPilot KVM here:
➜ learnlinux.link/tinypilot
Note: Royalties and/or commission is earned from each of the above links
Time Codes
00:00 - Intro
01:01 - Spin up your very own Linux-based cloud server with Linode (sponsor)
02:22 - Creating a copy of the /etc (used in the examples)
04:38 - The tar command
05:17 - Basic usage of the tar command
08:36 - Viewing the contents of a tar file
10:53 - Viewing the contents of a tar file (in verbose mode)
13:41 - How to extract a tar file
15:46 - The gzip command
16:42 - Basic usage of the gzip command
18:10 - Uncompressing a gzip file with the gunzip command
20.04 - Combining tar and gzip to create a compressed archive
22:58 - Viewing the contents of a gzipped tar file
23:33 - Extracting a gzipped tar file
Full Courses from Learn Linux TV
• Linux Essentials Certification Workshop ➜ learnlinux.link/lpi-course
• Linux Crash Course series ➜ linux.video/cc
• Learn how to use tmux ➜ linux.video/tmux
• Learn how to use vim ➜ linux.video/vim
• Bash Scripting Series ➜ linux.video/bash
• Proxmox VE Cluster Full Course ➜ linux.video/pve
• Learn Ansible ➜ linux.video/ansible
Linux-related Podcasts
• Enterprise Linux Security ➜ enterpriselinuxsecurity.show
• The Homelab Show ➜ thehomelab.show
Learn Linux TV on the Web
• Main site ➜ www.learnlinux.tv
• Community ➜ community.learnlinux.tv
• Enterprise Linux Security Podcast ➜ enterpriselinuxsecurity.show
• The Homelab Show Podcast ➜ thehomelab.show
• Content Ethics ➜ www.learnlinux.tv/content-ethics
• Request Assistance ➜ www.learnlinux.tv/request-ass...
Disclaimer
Learn Linux TV provides technical content that will hopefully be helpful to you and teach you something new. However, this content is provided without any warranty (expressed or implied). Learn Linux TV is not responsible for any damages that may arise from any use of this content. The person viewing Learn Linux TV's content is expected to follow their best judgement and to make their best decisions while working with any related technology. Always make sure you have written permission before working with any infrastructure. Also, be sure that you're compliant with all company rules, change control procedures, and local laws.
#LinuxTutorial #LearnLinux #Linux

Пікірлер: 57

  • @hoid8069
    @hoid8069Ай бұрын

    Thank you for explaining what each of the flags mean in commands. So many Linux tutorials don't do that, and it drives me crazy.

  • @user-cy4xl9cc1q
    @user-cy4xl9cc1q2 ай бұрын

    The best basic tutorial on tar and gzip tools I've ever found. Others just explain options approximately like this - "well these -cvf or whatever options are needed so everything is ok". Again, thank you for clarifying this.

  • @vb9950
    @vb9950Ай бұрын

    Thank you for the video. I had actually gone through the entire part. In my mind, archiving and compressing are the same operations on file just synonymous. But after the video I realized archiving and compressing are different operations. And we use it together that is, tar for archiving and this archived file will be compressed by gzip.

  • @WC1376C22
    @WC1376C22 Жыл бұрын

    You never disappoint Jay. I must always have gedit open when I hit play on your videos, even if I already know about whatever it is, you always manage to ninja in something I didn't know.🤣 WHat you didnt cover and I would consider important is "--exclude=" and the "--exclude" file list....I can never remember where to put this at...good thing I have a .txt cheat sheet.

  • @andydroid2954
    @andydroid2954 Жыл бұрын

    One of the best KZread channels to learn about Linux.

  • @DL-xf3ur
    @DL-xf3ur Жыл бұрын

    Awesome as always Jay! Thanks.

  • @vinuka_vinnath
    @vinuka_vinnath3 ай бұрын

    Perfect as always!🔥

  • @Benjamin-lh6dq
    @Benjamin-lh6dq Жыл бұрын

    Excellent, as always. I enjoyed this video a lot.

  • @raymondfb
    @raymondfb Жыл бұрын

    great video! thank you for taking the time to make it.

  • @jhred3315
    @jhred3315 Жыл бұрын

    Awesome as always!

  • @crites57
    @crites57 Жыл бұрын

    Thanks Jay, yet another great video.

  • @AnantaAkash.Podder
    @AnantaAkash.Podder3 ай бұрын

    The best Channel to learn Linux... Thank you very much sir...❤️❤️❤️

  • @portfedh
    @portfedh Жыл бұрын

    These videos are great. Thanks for posting Jay.

  • @LearnLinuxTV

    @LearnLinuxTV

    Жыл бұрын

    Glad you like them!

  • @act.13.41
    @act.13.41 Жыл бұрын

    I would consider myself an expert with compressed files in Windows, but a complete noob in Linux. I really needed this and it was awesome. Thank you so much.

  • @synen

    @synen

    Жыл бұрын

    I still use rar in Linux

  • @amirsayad9352
    @amirsayad93524 ай бұрын

    thanks dude. i enjoyed it

  • @machman23
    @machman23 Жыл бұрын

    Another well explained and demoed video

  • @simmzzzz
    @simmzzzz2 ай бұрын

    Fantastic! Thanks! :)

  • @polliluiz
    @polliluiz Жыл бұрын

    Amazing my friend. Greetings from Brazil

  • @13thravenpurple94
    @13thravenpurple94 Жыл бұрын

    Great work 🥳🥳🥳 Thank you 💜💜💜

  • @burpsan
    @burpsan Жыл бұрын

    Excellent! Thank you!

  • @nouhatamba9976
    @nouhatamba9976 Жыл бұрын

    you're the best huge thank to you for all that knowledge that you allow us to access freely

  • @MohamedELSayed-to9jj
    @MohamedELSayed-to9jj Жыл бұрын

    Thank you for efforts and quality

  • @vasylcf
    @vasylcf Жыл бұрын

    Thank you man! I like you way of explanation)

  • @AbuFaizal
    @AbuFaizal Жыл бұрын

    Nice tutorial

  • @manriqueprendas3856
    @manriqueprendas38568 ай бұрын

    Thanks a lot!

  • @MidnightSpecter43
    @MidnightSpecter43 Жыл бұрын

    Sir Here etc file size is 12k and after compression why it is 1.5 Mb ??

  • @yjawhar

    @yjawhar

    6 ай бұрын

    That's the folder size, not the folder and files. If you want to see the size of the folder and files, check the size of etc_backup.tar file and compare that to the tar.gz file

  • @cleightthejw2202
    @cleightthejw2202 Жыл бұрын

    @Jay thanks for the linux curse with these videos. They truly are good. AND! your audio is nice and loud.

  • @dcknature

    @dcknature

    Жыл бұрын

    Yeah, sounds really nice on a mobile device 👍.

  • @fabrice9848
    @fabrice9848 Жыл бұрын

    Thank you

  • @busdriver1261
    @busdriver1261 Жыл бұрын

    Thanks for unravelling the mystery (for me at least) of tar and gzip. It's one of those things I knew I had to learn but never got around to. Problem solved!

  • @gilberttorres2655
    @gilberttorres2655 Жыл бұрын

    excellent

  • @Limberth11
    @Limberth11 Жыл бұрын

    Hi Jay, as usual, awesome content, are you planning on SELinux Crash Course?

  • @saucerbob
    @saucerbob Жыл бұрын

    Great stuff. I gotta get back to command line administration. GUI interface is handy, and easy; but there is so much more power and flexibility in the command line. What's next - CPIO?

  • @virtuallifeform

    @virtuallifeform

    Жыл бұрын

    *cpio* is very powerful and flexible when fed by *find*

  • @clivewi9103
    @clivewi91038 ай бұрын

    If you do an advanced course on TAR, could you cover how to force an over write of an existing file from the tar archive.

  • @pogo55555
    @pogo55555 Жыл бұрын

    Hello people. Jay's book "Mastering Ubuntu Server" is EXCELLENT. I am reading the 3rd edition.

  • @lawrencebutler2423
    @lawrencebutler2423 Жыл бұрын

    Hey man I wanted you yo know I talked to my University about adding your videos to the curriculum. They took it VERY serious. Expect a call man=)

  • @pyrokamileon
    @pyrokamileon Жыл бұрын

    I honestly did not realize that tar and gzip were separate commands that did different things!

  • @2mustange
    @2mustange Жыл бұрын

    Encryption could be a good next course.

  • @dcknature
    @dcknature Жыл бұрын

    Versatile tutorial, Jay 👍! Thanks and greetings from Ukraine 🇺🇦.

  • @buttonsplaymusic4896
    @buttonsplaymusic4896 Жыл бұрын

    Fun video, but I would also like to know how to compress/zip to multiple files, and then reunite them

  • @TheIceMan9304
    @TheIceMan9304 Жыл бұрын

    Hey Jay is it just me or is your "journey" plaque not level in the background?

  • @candyxoxo28
    @candyxoxo285 ай бұрын

    How can I delete large number of files from target.gz file?

  • @guilherme5094
    @guilherme5094 Жыл бұрын

    👍

  • @WizardAus
    @WizardAus13 күн бұрын

    after changing my ownership permissions to my user I was unable to run the command 'tar -cf etc_bkp.tar etc/' -- the output I received was: tar: etc/gshadow-: Cannot open: Permission denied tar: etc/shadow-: Cannot open: Permission denied tar: etc/gshadow: Cannot open: Permission denied tar: etc/shadow: Cannot open: Permission denied tar: Exiting with failure status due to previous errors I then put sudo in front of it and I was allowed, how come I was unable even though my permissions were changed

  • @46dude41
    @46dude41 Жыл бұрын

    Gunzip is terribly inneficient. It only uses one core of the proccessor. I used to do backups this way and changed to "pigz" wich is the modern versión of gunzip for multiprocessors.

  • @radarguru
    @radarguru Жыл бұрын

    Jay, am I safe to assume it will include hidden files as well?

  • @robertklimowicz5008

    @robertklimowicz5008

    Жыл бұрын

    yes

  • @_GhostMiner
    @_GhostMiner Жыл бұрын

    Just use 7zip instead of having to do the tar and then the gzip.

  • @edgewood99
    @edgewood99 Жыл бұрын

    I was surprised to see the original file disappear after gzip compressed it. That was scary. Where went the original?

  • @jim7smith

    @jim7smith

    Жыл бұрын

    If your purpose was to save room on the drive, you would want exactly that action to take place. The original is still there, it is just made to take up less room on your drive. Of course the main purpose is to create a backup of existing file(s) that does not take up much room on the backup location. AND Jay was careful to point out that you would NOT do this on your /etc directory, which would bork your system. Additionally, there are many more options to the commands which Jay did not mention because they were out of scope for the purpose of the video which was a basic intro to the usage of both tar and gzip and gunzip.

  • @zeppelinmexicano
    @zeppelinmexicano4 ай бұрын

    Nice video but I would never use etc as an example with people who don't know what they are doing. I know, you warned them, but I still cringe. What can go wrong? That is the first question to ask. Answer: plenty when the user doesn't know how a file system works.

  • @TheExard3k
    @TheExard3k Жыл бұрын

    Why not use filesystem compression and never worry about compressing your files ever again? I admit I have to deal with zipped stuff, so it's good to know how to best deal with them. Otherwise ZFS and BTRFS cover all my storage, incl. compression.

  • @virtuallifeform

    @virtuallifeform

    Жыл бұрын

    Totally different use case. And it doesn't help at all when you want to exchange sets of files with other people.

Келесі