exu,

That looks really cool. And finally a guide that knows -z is not necessary all the time.

yum13241,

tar, please eXtract the Vucking File!

tar -xvf tarbomb.tar.

pomodoro_longbreak,
@pomodoro_longbreak@sh.itjust.works avatar

^r tar and adjust as needed. Got it

admin,

My tar command is tldr tar then ctrl + c / ctrl + v

1984,
@1984@lemmy.today avatar

daily-standup.png eh… :)

Who is taking pics of the standup… :)

Magister,
@Magister@lemmy.world avatar

Damn, I’m using the “tape archiver” (this is what tar means) since I installed HPUX8 in the 90s, from tape, yes…

MangoPenguin,
@MangoPenguin@lemmy.blahaj.zone avatar

So a serious question from someone who can’t remember console commands ever despite using them constantly.

Why are so many linux CLI commands set up with defaults that no one ever uses? Like if you pretty much always need -f, -v is often used, and –auto-compress is needed to recognize type by extension. Why aren’t those the defaults to just using tar?

A lot of applications I find are like this too, they don’t come with defaults that work or that anyone would ever use.

sonnenzeit,

One reason to keep in mind is backwards compatibility and the expectancy that every Linux system has the same basic tools that work the same.

Imagine you have a script running on your server that uses a command with or without specific arguments. If the command (say tar) changes its default parameters this could lead to a lot of nasty side effects from crashes to lost or mangled data. Besides the headache of debugging that, even if you knew about the change beforehand it’s still a lot effort to track down every piece of code that makes use of that command and rewrite it.

That’s why programs and interfaces usually add new options over time but are mostly hesitant to remove old ones. And if they do they’ll usually warn the others beforehand that a feature will deprecate while allowing for a transitional period.

One way to solve this conundrum is to simply introduce new commands that offer new features and a more streamlined approach that can replace the older ones in time. Yet a distribution can still ship the older ones alongside the newer ones just in case they are needed.

Looking at pagers (programs that break up long streams of text into multiple pages that you can read one at a time) as a simple example you’ll find that more is an older pager program while the newer less offers an even better experience (“less is more”, ¿get the joke?). Both come pre-installed as core tools on many distributions. Finally an even more modern alternative is most, another pager with even better functionality, but you’ll need to install that one yourself.

MangoPenguin,
@MangoPenguin@lemmy.blahaj.zone avatar

That makes sense!

callyral,
@callyral@pawb.social avatar

I would also recommend -v for verbose and -z when compressing for gzip

What does --auto-compress do?

crmsnbleyd,
@crmsnbleyd@sopuli.xyz avatar

Auto compress will use gzip if the file ends with .gz, bzip if it ends with .bz, and so on without mentioning -z

Blackmist,

Yes, that’s all very well, but you’ll still need to find that image the next time you want to use it.

Gecko,
@Gecko@lemmy.world avatar

Or just use long-forms like


<span style="color:#323232;">tar --create --file pics.tar ./pics
</span>

instead of


<span style="color:#323232;">tar -cf pics.tar ./pics
</span>

or


<span style="color:#323232;">tar --extract --file pics.tar```
</span><span style="color:#323232;">instead of
</span>

tar -xf pics.tar


<span style="color:#323232;">
</span><span style="color:#323232;">which is honestly way easier to remember... ^^
</span>
h_a_r_u_k_i,

Nowaday I have ChatGPT spew me command. I usually do a quick validation before running. Nevertheless, most of simple operations are correct so I don’t need to.

I then note the command to my persional gist cheatsheet. Next time, since the command is “cached”, I’ll be able to be productive quicker.

So much better than googling.

Zacryon,

Ah yes, that’s the linux community as I know it. There is one thing someone wants to achieve and dozens of ways to do it. ;)

https://feddit.de/pictrs/image/1f40c1f5-280f-466a-9c47-f023172986f0.png

pineapplelover,

Nah I just use 7z

freijon,

Just use Ouch!

MonkderZweite,

Or -I ‘compress-command’ -cf … if not supported.

iByteABit,

I’ve written a CLI tool in Rust as a front end to tar with gzip called Targez.

It can definitely just be done with an alias instead, but you can give it a try if you prefer something installable.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • linux@lemmy.ml
  • DreamBathrooms
  • everett
  • InstantRegret
  • magazineikmin
  • thenastyranch
  • rosin
  • GTA5RPClips
  • Durango
  • Youngstown
  • slotface
  • khanakhh
  • kavyap
  • ngwrru68w68
  • tacticalgear
  • JUstTest
  • osvaldo12
  • tester
  • cubers
  • cisconetworking
  • mdbf
  • ethstaker
  • modclub
  • Leos
  • anitta
  • normalnudes
  • megavids
  • provamag3
  • lostlight
  • All magazines