Live data from Hacker News

Learn just enough Linux to get things done

alexpetralia.com

111–120 of 138 posts

Re: Learn just enough Linux to get things done

#111
post #103

Earlier quoted context omitted.

> The third one is about tar. Why do people have such a difficult time with tar? The only tar commands I've ever needed (or seen other people need) are `tar cf ...` or `tar xf ...` (occasionally I'll need to chuck a z in there if the file is/needs to be gzipped), are other people just using far more complex tar commands than I am?

I've just never understood why tar can't have sane defaults like zip. Why do you need three or four cryptic arguments to do the most basic use case? Its like find. I try to remember the stupid syntax and just give up and use locate instead.

> I've just never understood why tar can't have sane defaults like zip.

Because tar means "tape archiver", and back when it was created, most of the time, you only needed one option: c, t or x (create, test, extract). You didn't need to pass f (file) because you actually piped tar to something that would append to a tape device (or read from it). And back then, compression (z, j, J, a) wasn't common place for tapes.

Re: Learn just enough Linux to get things done

#112
post #24

One example of this is the popular version control system (VCS) called git. Developers could have written this software to work on Windows, but they didn't. They wrote it to work on the command line for Linux because it was the ecosystem which already had all the tools they needed. I think the real (and even stronger) reason is that Linus Torvalds specifically built Git to serve as the VCS for the Linux codebase.

The real reason is that cmd.exe is nothing like bash/zsh/csh/etc. Every OS except Windows can use bash (or an equivalent shell) natively.

There is no advantage to writing another interface to git that is directly compatible with cmd or powershell.

Re: Learn just enough Linux to get things done

#113

Hi everybody - author here. Surprised to see this on the front page. I agree with most of the feedback and criticism here. Hopefully some readers found it helpful regardless.

It's ... pretty OK :-). My points/suggestions...

1. I've never heard of tabview and it's not on MacOS or Fedora.

2. Add ctrl-D to your possible exits. It's actually more common than ctrl-C.

3. Some of those commands are not installed by default on many systems; e.g. htop or dstat. And they require sdvanced knowledge to properly interpret. But they can be very useful. I'd suggest standard `top` and things like iostat instead.

Re: Learn just enough Linux to get things done

#114
post #8

Earlier quoted context omitted.

Over years I've heard a lot of complains on tar being hard to use, but in real-life I really ever had to use only these two commands: tar zcvf and tar zxvf. It's actually quite easy to remember: tar Zip Compress Verbose File, and tar Zip eXtract Verbose File.

add 'tar r' and 'tar u' to your arsenal.

In about 40 years of using Unix I have never used r or u.

Re: Learn just enough Linux to get things done

#115
post #50

Earlier quoted context omitted.

The fact that you think a DOS command line c. 1993 and a Unix one (from, say, 1984 even!) are comparable basically ends this argument, you realize, right?

Yup you're right, the extensive argument you provided has completely convinced me of my errors. /s The point I was making was that they're just different systems and approach things in different ways. Trying to say one is more "developer focused" than the other is a useless metric(which we'll take forever trying to define what "developer focused" even means). One could make similar arguments about the Alto not having…

I dunno.

UNIX and thus Linux are all about pure user power. The shell is great and there are lots of tools available by default like Awk, Perl, Python, TCL, Sed, GCC, Vim, Emacs...etc. The entire OS isn't perfect, but is designed for people who know what they're doing. Compare that with CMD & Batch and it is Linux is like an SUV that can also fly and shoot lasers while Windows is like a moped. Of course I'm exaggerating a good bit, but even Powershell has a lot of issues and doesn't allow you to easily do what you can in Linux. In Linux everything is text and it's easy to pipe things around. In Windows it's all objects and frustration. I agree that Smalltalk on the Alto is pretty cool, but Windows is nothing like that besides having some OO stuff. Something I do all the time on Linux is "locate filename" and pipe that to "grep" to be more specific. On Windows, open up the search Window and pray you can narrow it down or wait a very long time.

I use Windows and Linux at work. On Linux I feel like everything is designed to increase my productivity as are the tools at my disposal. On Windows, I'm always fighting the lack of good tools. Sure Visual Studio + .NET is pretty good if that is your thing, but I personally don't like having to open an IDE that uses that kind of resources if I essentially need to write a simple script. I've spent quite a bit of time with Powershell, but it simply isn't as productive as Linux due to the increased complexity. Sorry for the rant, but as i spend a lot of time with both OS, I have strong feelings on this.

Re: Learn just enough Linux to get things done

#116
post #25

Mentioning strace in an article titled "Learn just enough Linux to get things done" seems so out of place as to be absurd, even in an "Advanced" section. Anyone who needs the rest of this advice is going to be absolutely baffled by strace. Otherwise, decent little primer.

Even 'netstat | head -n20' is out of place for introductory Linux.

Not sure bout netstat, but I pipe text to | head and use the -n flag to specify # of lines all the time.

Re: Learn just enough Linux to get things done

#117

Earlier quoted context omitted.

Here's the full quote: "What resulted was an expansive suite of programs and utilities (collectively, software) that were written in Linux, for Linux - much of which was never ported to Windows. One example of this is the popular version control system (VCS) called git. Developers could have written this software to work on Windows, but they didn't. " It's just wrong.

Technically it's correct. It's just really odd in tone; it almost sounds like it's unusual or negative that these utilities were not written to be completely cross-platform, as if that would be a norm.

But git is not an example of software that wasn't ported to windows. It was ported to windows.

Re: Learn just enough Linux to get things done

#118
post #8

Earlier quoted context omitted.

Over years I've heard a lot of complains on tar being hard to use, but in real-life I really ever had to use only these two commands: tar zcvf and tar zxvf. It's actually quite easy to remember: tar Zip Compress Verbose File, and tar Zip eXtract Verbose File.

You can just do `tar caf` and `tar xaf`. It detects the archive format automatically (and I personnally find it easier to remember: "compress-as-fuck" and "extract-as-fuck").

wow thanks for that :)

Re: Learn just enough Linux to get things done

#119
post #24

One example of this is the popular version control system (VCS) called git. Developers could have written this software to work on Windows, but they didn't. They wrote it to work on the command line for Linux because it was the ecosystem which already had all the tools they needed. I think the real (and even stronger) reason is that Linus Torvalds specifically built Git to serve as the VCS for the Linux codebase.

Linus wrote it with the code library interface only in mind. the cli was a hodgepodge just to access the interface, and i bet he had a bunch of other specialized hacky binaries that he used for his day to day tasks.

Re: Learn just enough Linux to get things done

#120
> Basic tasks, like file parsing, job scheduling, and text search are more involved than running a command-line utility

This seems backwards. Going to the command line for these things is a horrible workflow. It’s not necessary in Linuxes either ...

Post reply on HN