23
DavRant
6y

!rant
Challenge for all Linux users:
You have to unpack sometarball.tgz
You have 10 seconds.
No googling!
Can you do it?

Comments
  • 2
  • 1
    dtrx sometarball.tgz
  • 6
  • 2
    Tar xvfz sometarball.tgz
  • 17
    tar -xvzfghjaeafgk
  • 4
    @growling close..enough?
  • 1
    Wouldn't the better test be that you have to tarball up some files? I usually forget which way round the tarball name and the items to tarball go...
  • 5
    sudo rm. /file
    Works every time
  • 2
    I remembered -xzf, I don't know what it does but it works
  • 0
    I don’t use the -(Options).
    I just do tar xvf file.tar.gz whatever.
  • 0
    file sometarball.tgz # to confirm file format
    tar xvf sometarball.tgz # if it was indeed a tarball
  • 0
    Tar -xvf "archive"

    The v does not even have to be there tho.
  • 1
  • 0
    unp anyarchivefile
  • 2
    Just double-click the file? Works in nautilus.
  • 2
    Double click.
  • 1
    I once printed myself a little table to remember how the tar command works, but by the time I actually hit the print button, I knew them by heart because I spent so much time on prettifying the little table, so I eventually threw that piece of paper away right after printing it.
  • 0
  • 6
    I think im fine
  • 3
    On my phone and couldn’t seem to be able to copy this to a pastebin somehow.

    My function 'extract' for extracting any compressed file

    # extract: Extract most know archives with one command
    # ---------------------------------------------------------
    extract () {
    if [ -f $1 ] ; then
    case $1 in
    *.tar.bz2) tar xjf $1 ;;
    *.tar.gz) tar xzf $1 ;;
    *.bz2) bunzip2 $1 ;;
    *.rar) unrar e $1 ;;
    *.gz) gunzip $1 ;;
    *.tar) tar xf $1 ;;
    *.tbz2) tar xjf $1 ;;
    *.tgz) tar xzf $1 ;;
    *.zip) unzip $1 ;;
    *.Z) uncompress $1 ;;
    *.7z) 7z x $1 ;;
    *) echo "'$1' cannot be extracted via extract()" ;;
    esac
    else
    echo "'$1' is not a valid file"
    fi
    }
  • 1
    I thought this is something covered in the first hour of UNIX 101.

    Maybe I'm just old and have extracted way too many compressed tar archives in my days.
  • 0
    tar -xzf someball.tar.gz
  • 1
    @ChainsawBaby I'm using this for such a long time, I just found it with the function name "ex".
  • 0
    tar xzf sometarball.tz
  • 0
    @fuck2code tfw you are the creator of that thread😀
  • 0
  • 0
    tar xf somepackage.tar.gz

    Tar will automatically guess the compression, no need for -z
Add Comment