wget, tar xzvf, cd, ls

wtzc () { wget "$@"; foo=`echo "$@" | sed 's:.*/::'`; tar xzvf $foo; blah=`echo $foo | sed 's:,*/::'`; bar=`echo $blah | sed -e 's/\(.*\)\..*/\1/' -e 's/\(.*\)\..*/\1/'`; cd $bar; ls; }
Combines a few repetitive tasks when compiling source code. Especially useful when a hypen in a file-name breaks tab completion. 1.) wget source.tar.gz 2.) tar xzvf source.tar.gz 3.) cd source 4.) ls From there you can run ./configure, make and etc.
Sample Output
[user@host Downloads]$ wtzc http://www.zlib.net/zlib-1.2.3.tar.gz
--2010-01-17 03:19:56--  http://www.zlib.net/zlib-1.2.3.tar.gz
Resolving www.zlib.net... 69.73.181.135
Connecting to www.zlib.net|69.73.181.135|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 496597 (485K) [application/x-tar]
Saving to: `zlib-1.2.3.tar.gz'

100%[======================================>] 496,597      337K/s   in 1.4s    

2010-01-17 03:19:58 (337 KB/s) - `zlib-1.2.3.tar.gz' saved [496597/496597]

zlib-1.2.3/
zlib-1.2.3/adler32.c
zlib-1.2.3/algorithm.txt
zlib-1.2.3/amiga/
zlib-1.2.3/amiga/Makefile.pup
zlib-1.2.3/amiga/Makefile.sas
zlib-1.2.3/as400/
zlib-1.2.3/as400/bndsrc
zlib-1.2.3/as400/compile.clp
zlib-1.2.3/as400/readme.txt
zlib-1.2.3/as400/zlib.inc
zlib-1.2.3/ChangeLog
zlib-1.2.3/compress.c
zlib-1.2.3/configure
zlib-1.2.3/contrib/
zlib-1.2.3/contrib/ada/
zlib-1.2.3/contrib/ada/buffer_demo.adb
zlib-1.2.3/contrib/ada/mtest.adb
zlib-1.2.3/contrib/ada/read.adb
zlib-1.2.3/contrib/ada/readme.txt
zlib-1.2.3/contrib/ada/test.adb
zlib-1.2.3/contrib/ada/zlib-streams.adb
zlib-1.2.3/contrib/ada/zlib-streams.ads
zlib-1.2.3/contrib/ada/zlib-thin.adb
zlib-1.2.3/contrib/ada/zlib-thin.ads
zlib-1.2.3/contrib/ada/zlib.adb
zlib-1.2.3/contrib/ada/zlib.ads
zlib-1.2.3/contrib/ada/zlib.gpr
zlib-1.2.3/contrib/asm586/
zlib-1.2.3/contrib/asm586/match.S
zlib-1.2.3/contrib/asm586/README.586
zlib-1.2.3/contrib/asm686/
zlib-1.2.3/contrib/asm686/match.S
zlib-1.2.3/contrib/asm686/README.686
zlib-1.2.3/contrib/blast/
zlib-1.2.3/contrib/blast/blast.c
zlib-1.2.3/contrib/blast/blast.h
zlib-1.2.3/contrib/blast/Makefile
zlib-1.2.3/contrib/blast/README
zlib-1.2.3/contrib/blast/test.pk
zlib-1.2.3/contrib/blast/test.txt
zlib-1.2.3/contrib/delphi/
zlib-1.2.3/contrib/delphi/readme.txt
zlib-1.2.3/contrib/delphi/ZLib.pas
zlib-1.2.3/contrib/delphi/ZLibConst.pas
zlib-1.2.3/contrib/delphi/zlibd32.mak
zlib-1.2.3/contrib/dotzlib/
zlib-1.2.3/contrib/dotzlib/DotZLib/
zlib-1.2.3/contrib/dotzlib/DotZLib/AssemblyInfo.cs
zlib-1.2.3/contrib/dotzlib/DotZLib/ChecksumImpl.cs
zlib-1.2.3/contrib/dotzlib/DotZLib/CircularBuffer.cs
zlib-1.2.3/contrib/dotzlib/DotZLib/CodecBase.cs
zlib-1.2.3/contrib/dotzlib/DotZLib/Deflater.cs
zlib-1.2.3/contrib/dotzlib/DotZLib/DotZLib.cs
zlib-1.2.3/contrib/dotzlib/DotZLib/DotZLib.csproj
zlib-1.2.3/contrib/dotzlib/DotZLib/GZipStream.cs
zlib-1.2.3/contrib/dotzlib/DotZLib/Inflater.cs
zlib-1.2.3/contrib/dotzlib/DotZLib/UnitTests.cs
zlib-1.2.3/contrib/dotzlib/DotZLib.build
zlib-1.2.3/contrib/dotzlib/DotZLib.chm
zlib-1.2.3/contrib/dotzlib/DotZLib.sln
zlib-1.2.3/contrib/dotzlib/LICENSE_1_0.txt
zlib-1.2.3/contrib/dotzlib/readme.txt
zlib-1.2.3/contrib/infback9/
zlib-1.2.3/contrib/infback9/infback9.c
zlib-1.2.3/contrib/infback9/infback9.h
zlib-1.2.3/contrib/infback9/inffix9.h
zlib-1.2.3/contrib/infback9/inflate9.h
zlib-1.2.3/contrib/infback9/inftree9.c
zlib-1.2.3/contrib/infback9/inftree9.h
zlib-1.2.3/contrib/infback9/README
zlib-1.2.3/contrib/inflate86/
zlib-1.2.3/contrib/inflate86/inffas86.c
zlib-1.2.3/contrib/inflate86/inffast.S
zlib-1.2.3/contrib/iostream/
zlib-1.2.3/contrib/iostream/test.cpp
zlib-1.2.3/contrib/iostream/zfstream.cpp
zlib-1.2.3/contrib/iostream/zfstream.h
zlib-1.2.3/contrib/iostream2/
zlib-1.2.3/contrib/iostream2/zstream.h
zlib-1.2.3/contrib/iostream2/zstream_test.cpp
zlib-1.2.3/contrib/iostream3/
zlib-1.2.3/contrib/iostream3/README
zlib-1.2.3/contrib/iostream3/test.cc
zlib-1.2.3/contrib/iostream3/TODO
zlib-1.2.3/contrib/iostream3/zfstream.cc
zlib-1.2.3/contrib/iostream3/zfstream.h
zlib-1.2.3/contrib/masm686/
zlib-1.2.3/contrib/masm686/match.asm
zlib-1.2.3/contrib/masmx64/
zlib-1.2.3/contrib/masmx64/bld_ml64.bat
zlib-1.2.3/contrib/masmx64/gvmat64.asm
zlib-1.2.3/contrib/masmx64/gvmat64.obj
zlib-1.2.3/contrib/masmx64/inffas8664.c
zlib-1.2.3/contrib/masmx64/inffasx64.asm
zlib-1.2.3/contrib/masmx64/inffasx64.obj
zlib-1.2.3/contrib/masmx64/readme.txt
zlib-1.2.3/contrib/masmx86/
zlib-1.2.3/contrib/masmx86/bld_ml32.bat
zlib-1.2.3/contrib/masmx86/gvmat32.asm
zlib-1.2.3/contrib/masmx86/gvmat32.obj
zlib-1.2.3/contrib/masmx86/gvmat32c.c
zlib-1.2.3/contrib/masmx86/inffas32.asm
zlib-1.2.3/contrib/masmx86/inffas32.obj
zlib-1.2.3/contrib/masmx86/mkasm.bat
zlib-1.2.3/contrib/masmx86/readme.txt
zlib-1.2.3/contrib/minizip/
zlib-1.2.3/contrib/minizip/ChangeLogUnzip
zlib-1.2.3/contrib/minizip/crypt.h
zlib-1.2.3/contrib/minizip/ioapi.c
zlib-1.2.3/contrib/minizip/ioapi.h
zlib-1.2.3/contrib/minizip/iowin32.c
zlib-1.2.3/contrib/minizip/iowin32.h
zlib-1.2.3/contrib/minizip/Makefile
zlib-1.2.3/contrib/minizip/miniunz.c
zlib-1.2.3/contrib/minizip/minizip.c
zlib-1.2.3/contrib/minizip/mztools.c
zlib-1.2.3/contrib/minizip/mztools.h
zlib-1.2.3/contrib/minizip/unzip.c
zlib-1.2.3/contrib/minizip/unzip.h
zlib-1.2.3/contrib/minizip/zip.c
zlib-1.2.3/contrib/minizip/zip.h
zlib-1.2.3/contrib/pascal/
zlib-1.2.3/contrib/pascal/example.pas
zlib-1.2.3/contrib/pascal/readme.txt
zlib-1.2.3/contrib/pascal/zlibd32.mak
zlib-1.2.3/contrib/pascal/zlibpas.pas
zlib-1.2.3/contrib/puff/
zlib-1.2.3/contrib/puff/Makefile
zlib-1.2.3/contrib/puff/puff.c
zlib-1.2.3/contrib/puff/puff.h
zlib-1.2.3/contrib/puff/README
zlib-1.2.3/contrib/puff/zeros.raw
zlib-1.2.3/contrib/README.contrib
zlib-1.2.3/contrib/testzlib/
zlib-1.2.3/contrib/testzlib/testzlib.c
zlib-1.2.3/contrib/testzlib/testzlib.txt
zlib-1.2.3/contrib/untgz/
zlib-1.2.3/contrib/untgz/Makefile
zlib-1.2.3/contrib/untgz/Makefile.msc
zlib-1.2.3/contrib/untgz/untgz.c
zlib-1.2.3/contrib/vstudio/
zlib-1.2.3/contrib/vstudio/readme.txt
zlib-1.2.3/contrib/vstudio/vc7/
zlib-1.2.3/contrib/vstudio/vc7/miniunz.vcproj
zlib-1.2.3/contrib/vstudio/vc7/minizip.vcproj
zlib-1.2.3/contrib/vstudio/vc7/testzlib.vcproj
zlib-1.2.3/contrib/vstudio/vc7/zlib.rc
zlib-1.2.3/contrib/vstudio/vc7/zlibstat.vcproj
zlib-1.2.3/contrib/vstudio/vc7/zlibvc.def
zlib-1.2.3/contrib/vstudio/vc7/zlibvc.sln
zlib-1.2.3/contrib/vstudio/vc7/zlibvc.vcproj
zlib-1.2.3/contrib/vstudio/vc8/
zlib-1.2.3/contrib/vstudio/vc8/miniunz.vcproj
zlib-1.2.3/contrib/vstudio/vc8/minizip.vcproj
zlib-1.2.3/contrib/vstudio/vc8/testzlib.vcproj
zlib-1.2.3/contrib/vstudio/vc8/testzlibdll.vcproj
zlib-1.2.3/contrib/vstudio/vc8/zlib.rc
zlib-1.2.3/contrib/vstudio/vc8/zlibstat.vcproj
zlib-1.2.3/contrib/vstudio/vc8/zlibvc.def
zlib-1.2.3/contrib/vstudio/vc8/zlibvc.sln
zlib-1.2.3/contrib/vstudio/vc8/zlibvc.vcproj
zlib-1.2.3/crc32.c
zlib-1.2.3/crc32.h
zlib-1.2.3/deflate.c
zlib-1.2.3/deflate.h
zlib-1.2.3/example.c
zlib-1.2.3/examples/
zlib-1.2.3/examples/fitblk.c
zlib-1.2.3/examples/gun.c
zlib-1.2.3/examples/gzappend.c
zlib-1.2.3/examples/gzjoin.c
zlib-1.2.3/examples/gzlog.c
zlib-1.2.3/examples/gzlog.h
zlib-1.2.3/examples/README.examples
zlib-1.2.3/examples/zlib_how.html
zlib-1.2.3/examples/zpipe.c
zlib-1.2.3/examples/zran.c
zlib-1.2.3/FAQ
zlib-1.2.3/gzio.c
zlib-1.2.3/INDEX
zlib-1.2.3/infback.c
zlib-1.2.3/inffast.c
zlib-1.2.3/inffast.h
zlib-1.2.3/inffixed.h
zlib-1.2.3/inflate.c
zlib-1.2.3/inflate.h
zlib-1.2.3/inftrees.c
zlib-1.2.3/inftrees.h
zlib-1.2.3/make_vms.com
zlib-1.2.3/Makefile
zlib-1.2.3/Makefile.in
zlib-1.2.3/minigzip.c
zlib-1.2.3/msdos/
zlib-1.2.3/msdos/Makefile.bor
zlib-1.2.3/msdos/Makefile.dj2
zlib-1.2.3/msdos/Makefile.emx
zlib-1.2.3/msdos/Makefile.msc
zlib-1.2.3/msdos/Makefile.tc
zlib-1.2.3/old/
zlib-1.2.3/old/descrip.mms
zlib-1.2.3/old/Makefile.riscos
zlib-1.2.3/old/os2/
zlib-1.2.3/old/os2/Makefile.os2
zlib-1.2.3/old/os2/zlib.def
zlib-1.2.3/old/README
zlib-1.2.3/old/visual-basic.txt
zlib-1.2.3/old/zlib.html
zlib-1.2.3/projects/
zlib-1.2.3/projects/README.projects
zlib-1.2.3/projects/visualc6/
zlib-1.2.3/projects/visualc6/example.dsp
zlib-1.2.3/projects/visualc6/minigzip.dsp
zlib-1.2.3/projects/visualc6/README.txt
zlib-1.2.3/projects/visualc6/zlib.dsp
zlib-1.2.3/projects/visualc6/zlib.dsw
zlib-1.2.3/qnx/
zlib-1.2.3/qnx/package.qpg
zlib-1.2.3/README
zlib-1.2.3/trees.c
zlib-1.2.3/trees.h
zlib-1.2.3/uncompr.c
zlib-1.2.3/win32/
zlib-1.2.3/win32/DLL_FAQ.txt
zlib-1.2.3/win32/Makefile.bor
zlib-1.2.3/win32/Makefile.emx
zlib-1.2.3/win32/Makefile.gcc
zlib-1.2.3/win32/Makefile.msc
zlib-1.2.3/win32/VisualC.txt
zlib-1.2.3/win32/zlib.def
zlib-1.2.3/win32/zlib1.rc
zlib-1.2.3/zconf.h
zlib-1.2.3/zconf.in.h
zlib-1.2.3/zlib.3
zlib-1.2.3/zlib.h
zlib-1.2.3/zutil.c
zlib-1.2.3/zutil.h
adler32.c      crc32.c    INDEX       inftrees.h    qnx         zlib.3
algorithm.txt  crc32.h    infback.c   Makefile      README      zlib.h
amiga          deflate.c  inffast.c   Makefile.in   trees.c     zutil.c
as400          deflate.h  inffast.h   make_vms.com  trees.h     zutil.h
ChangeLog      example.c  inffixed.h  minigzip.c    uncompr.c
compress.c     examples   inflate.c   msdos         win32
configure      FAQ        inflate.h   old           zconf.h
contrib        gzio.c     inftrees.c  projects      zconf.in.h
[user@host zlib-1.2.3]$ 

-1
By: oshazard
2010-01-17 11:25:47

These Might Interest You

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: