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

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 ก.ค. 2024
  • 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 TH-cam 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
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 59

  • @user-cy4xl9cc1q
    @user-cy4xl9cc1q 2 หลายเดือนก่อน +1

    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.

  • @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.

  • @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.

  • @andydroid2954
    @andydroid2954 ปีที่แล้ว +2

    One of the best TH-cam channels to learn about Linux.

  • @WC1376C22
    @WC1376C22 ปีที่แล้ว +14

    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.

  • @DL-xf3ur
    @DL-xf3ur ปีที่แล้ว

    Awesome as always Jay! Thanks.

  • @act.13.41
    @act.13.41 ปีที่แล้ว +1

    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

  • @Benjamin-lh6dq
    @Benjamin-lh6dq ปีที่แล้ว +1

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

  • @vinuka_vinnath
    @vinuka_vinnath 3 หลายเดือนก่อน

    Perfect as always!🔥

  • @raymondfb
    @raymondfb ปีที่แล้ว

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

  • @crites57
    @crites57 ปีที่แล้ว

    Thanks Jay, yet another great video.

  • @portfedh
    @portfedh ปีที่แล้ว

    These videos are great. Thanks for posting Jay.

  • @jhred3315
    @jhred3315 ปีที่แล้ว

    Awesome as always!

  • @AnantaAkash.Podder
    @AnantaAkash.Podder 3 หลายเดือนก่อน

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

  • @burpsan
    @burpsan ปีที่แล้ว

    Excellent! Thank you!

  • @amirsayad9352
    @amirsayad9352 4 หลายเดือนก่อน

    thanks dude. i enjoyed it

  • @nouhatamba9976
    @nouhatamba9976 ปีที่แล้ว

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

  • @machman23
    @machman23 ปีที่แล้ว

    Another well explained and demoed video

  • @MidnightSpecter43
    @MidnightSpecter43 ปีที่แล้ว +5

    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

  • @MohamedELSayed-to9jj
    @MohamedELSayed-to9jj ปีที่แล้ว

    Thank you for efforts and quality

  • @13thravenpurple94
    @13thravenpurple94 ปีที่แล้ว

    Great work 🥳🥳🥳 Thank you 💜💜💜

  • @simmzzzz
    @simmzzzz 2 หลายเดือนก่อน

    Fantastic! Thanks! :)

  • @polliluiz
    @polliluiz ปีที่แล้ว +1

    Amazing my friend. Greetings from Brazil

  • @manriqueprendas3856
    @manriqueprendas3856 8 หลายเดือนก่อน

    Thanks a lot!

  • @vasylcf
    @vasylcf ปีที่แล้ว

    Thank you man! I like you way of explanation)

  • @fabrice9848
    @fabrice9848 ปีที่แล้ว

    Thank you

  • @AbuFaizal
    @AbuFaizal ปีที่แล้ว +1

    Nice tutorial

  • @eilayyosfan4417
    @eilayyosfan4417 20 ชั่วโมงที่ผ่านมา

    Thank you !

  • @busdriver1261
    @busdriver1261 ปีที่แล้ว +3

    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!

  • @cleightthejw2202
    @cleightthejw2202 ปีที่แล้ว +4

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

    • @dcknature
      @dcknature ปีที่แล้ว +1

      Yeah, sounds really nice on a mobile device 👍.

  • @Limberth11
    @Limberth11 ปีที่แล้ว

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

  • @gilberttorres2655
    @gilberttorres2655 ปีที่แล้ว

    excellent

  • @pogo55555
    @pogo55555 ปีที่แล้ว

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

  • @clivewi9103
    @clivewi9103 8 หลายเดือนก่อน

    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.

  • @saucerbob
    @saucerbob ปีที่แล้ว +1

    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*

  • @pyrokamileon
    @pyrokamileon ปีที่แล้ว

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

  • @dcknature
    @dcknature ปีที่แล้ว +12

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

  • @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=)

  • @2mustange
    @2mustange ปีที่แล้ว

    Encryption could be a good next course.

  • @TheIceMan9304
    @TheIceMan9304 ปีที่แล้ว

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

  • @buttonsplaymusic4896
    @buttonsplaymusic4896 ปีที่แล้ว

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

  • @candyxoxo28
    @candyxoxo28 5 หลายเดือนก่อน

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

  • @radarguru
    @radarguru ปีที่แล้ว

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

  • @WizardAus
    @WizardAus 18 วันที่ผ่านมา

    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 ปีที่แล้ว +2

    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.

  • @eilayyosfan4417
    @eilayyosfan4417 20 ชั่วโมงที่ผ่านมา

    i got a heart attack when you executed, rm -rf /etc

  • @guilherme5094
    @guilherme5094 ปีที่แล้ว

    👍

  • @_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
    @zeppelinmexicano 4 หลายเดือนก่อน

    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 ปีที่แล้ว +4

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