How to Use Tar on Linux | Command Line Tips from Linode's Top Docs

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ก.ค. 2024
  • tar provides a standard interface for bundling files on Linux. In this video, Jay from ‪@LearnLinuxTV‬ shows how to use tar in the command line.
    Chapters:
    0:00 Introduction
    0:47 Gathering files to use with tar
    3:05 What does tar do?
    3:46 How to create a tar file
    7:06 What’s inside of a tar?
    8:48 Creating a tar with a line count
    9:23 Creating a tar with verbose mode
    11:11 Extracting a tar file to a folder
    14:18 Using the gzip command
    16:40 Decompressing files with gunzip
    17:30 Combining gzip with tar
    21:30 Viewing the contents of a tar.gz file
    22:30 Conclusion
    New to Cloud Computing? Get started here with a $100 credit → www.linode.com/lp/youtube-vie...
    Read the doc for more information on tar → www.linode.com/docs/guides/co...
    Learn more about command line basics → www.linode.com/docs/guides/li...
    Subscribe to get notified of new episodes as they come out → th-cam.com/users/linode?sub_co...
    #Linode #Linux #tar #LinuxCommands
    Product: Linode, tar Command, Command Line; @LearnLinuxTV ;
  • วิทยาศาสตร์และเทคโนโลยี

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

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

    You are the Genuine Master of Linux in this World. God bless you.

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

    The only video I ever need for understanding tarball and compression! Thanks a lot Jay you are wonderful.

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

    I always get something useful from watching your videos, thanks mate.

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

    This tutorials ate awesome, so useful

  • @baruchben-david4196
    @baruchben-david4196 ปีที่แล้ว +1

    When using chown, if your group and user are the same, you can do chown -R name: . The colon implies the group is the same as the user.

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

    its fucking amazing I have to go to TH-cam to get taught shit. taking a college class for linux and they not teaching me shit. dunno why I'm paying for nothing

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

    I know this is an example but making a backup of /etc and make all files belong to a non sudo user makes the files unusable.

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

    Thanks Jay. What's the difference between etc and /etc?

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

      /etc means the directory 'etc' located in the root of the filesystem, which is represented by the / character by itself, the full path of the directory being /etc, and is a directory that exists on every Linux system as a place to store system-wide configuration files
      the etc directory without the slash was a newly-created directory by Jay, which was created in Jay's home directory when he copied it from /etc
      the full path of Jay's etc copy would be /home/jay/etc, or represented in short as ~/etc, with ~ being shorthand for your own user's home directory, but was simply referred to as 'etc' because Jay was already working from within his own home directory, therefore specifying its full path was unnecessary

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

      @@shallex5744 thanks , also how would you differentiate/understand Trailing slashes / example - when using mv command or something else - mv source /dir or mv source/ /dir/

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

      @@abhishektyagi4428 i'm not sure, i never use trailing slashes (intentionally), but after testing it just now, moving the file source/ with the slash at the end doesn't work because putting the slash at the end makes the mv command think you're trying to move a directory when it is actually a file, and gives the error "Not a directory"

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

    I've often wondered, as the tar file is uncompressed and the same size as all files combined why not just create a new directory instead of the tar file? The directory can be compressed if there is a need to save space.

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

      The command syntax you're looking for is:
      tar -xf $FILENAME.tar.gz --one-top-level=$NEW_DIRECTORY_NAME
      This will create a new directory within your current directory and unzip the contents of the tarball into that directory. On its own, tar just bundles files, you'd need to add -c to your command to actually compress the newly created tarball.