Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Nhil1647yWouldn'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...
-
file sometarball.tgz # to confirm file format
tar xvf sometarball.tgz # if it was indeed a tarball -
Meta33347yI 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.
-
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
} -
slar3007yI 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. -
@ChainsawBaby I'm using this for such a long time, I just found it with the function name "ex".
-
-vim-31257ytar xf somepackage.tar.gz
Tar will automatically guess the compression, no need for -z
Related Rants
-
gururaju56*Now that's what I call a Hacker* MOTHER OF ALL AUTOMATIONS This seems a long post. but you will definitely ...
-
linuxxx70This guy at my last internship. A windows fanboy to the fucking max! He was saying how he'd never use anythi...
-
creedasaurus62Another dev on my team just got a new machine. Before he came in today I made two separate USB installers and ...
!rant
Challenge for all Linux users:
You have to unpack sometarball.tgz
You have 10 seconds.
No googling!
Can you do it?
rant
linux
tar