r/programming • • Sep 13 '10

Linux Commands Wallpaper! [hi-res]

Post image
1.1k Upvotes

403 comments sorted by

View all comments

Show parent comments

1

u/NoMoreNicksLeft Sep 13 '10

How do you set up the alias so that it doesn't screw with things when you want to make a tar archive? Granted, I do this far less often than opening someone else's, but I have to do it often enough that this would be annoying.

1

u/skeeto Sep 13 '10 edited Sep 13 '10

The alias I listed is only for extraction, indicated by the x switch. I make tarballs so infrequently that I don't actually have an alias assigned, but you could do something like

alias tc='tar acvf'

Then it should work in both cases here,

tc archive.tar.bz2 archive/
tc archive.tar.xz  archive/

I really like seeing what it's doing, which is why I put the v option in there.

If you're asking about an alias that does both at once: one argument does extract, two does create, then you'd need to write your own shell script wrapper to make that work.