Live data from Hacker News

Linux Terminal Tools [pdf]

ketancmaheshwari.github.io

31–40 of 57 posts

Re: Linux Terminal Tools [pdf]

#31

It's a shame that a whole generation of people who want to be IT literate think that this is "Linux". This is Unix. Would we name a map book "A Toyota Roadmap", as if we don't know that there are other cars, and that a map applies to cars, not just to Toyotas specifically? Sure, a map would be different for push scooters (Windows), but a map would be the same for cars and small trucks. It seems petty, but it becomes…

I think by that analogy the title should have been "Computer Operating Systems Terminal Tools". The tools presented in the slides have been tested on a Linux System, which motivated the title name.

That would be incorrect: it's too general. These tools don't apply to Windows; yet some do apply to MacOS, due to its BSD/UNIX (not Linux) roots.

Re: Linux Terminal Tools [pdf]

#32

It's a shame that a whole generation of people who want to be IT literate think that this is "Linux". This is Unix. Would we name a map book "A Toyota Roadmap", as if we don't know that there are other cars, and that a map applies to cars, not just to Toyotas specifically? Sure, a map would be different for push scooters (Windows), but a map would be the same for cars and small trucks. It seems petty, but it becomes…

I think the reason that it seems petty is that distinction is just not useful information for most people. It’s at best a historical asterisk on whatever is being discussed. I don’t use Unix, and I don’t know anyone that uses Unix. Linux tools seems right to me because, I get the tools from whatever flavor of Linux OS I installed.

Re: Linux Terminal Tools [pdf]

#33

This function will fail when given an argument with a space, which would be quite frustrating for a beginner, which is presumably the target audience for such a document: > mcd() { mkdir -p $1; cd $1 } It should be more like: > mcd() { mkdir -p "$1"; cd "$1"; } The trailing ";" is also required in bash for oneline blocks like this. Same goes for most of the other functions on page 70. "$@", etc. Just trying to make t…

I still do this reflexively but zsh doesn’t word-split variable expansions, so the first version would work as expected.

Little things like this have made me prefer using zsh whenever feasible: and, in the age of dockerized everything, there’s few good reasons left to use bash.

Re: Linux Terminal Tools [pdf]

#34

It's a shame that a whole generation of people who want to be IT literate think that this is "Linux". This is Unix. Would we name a map book "A Toyota Roadmap", as if we don't know that there are other cars, and that a map applies to cars, not just to Toyotas specifically? Sure, a map would be different for push scooters (Windows), but a map would be the same for cars and small trucks. It seems petty, but it becomes…

> It's a shame that a whole generation of people who want to be IT literate think that this is "Linux". This is Unix.

Is it though?

Disclaimer: I am an old Unix hand (a literal graybeard). I started using Unix back in the mid 1980s, when a dual VAX 11/780 was hot stuff. I've used most of the major Unix distributions that ever existed.

In terms of server market share [1], Unix these days is, like, 95% Linux in various distros, with Windows, Free/Open/NetBSD, Illuminos, and a few others rounding out the top 10.

We can and should honor the past, and the innovators that made today's compute environment possible. But in a sense, "Unix" is a historical legacy, and denying that isn't useful.

[1] Because outside of some hobbyists, who is running traditional Unix on the desktop these days? Desktop "Unix" is really OSX and Linux these days.

Re: Linux Terminal Tools [pdf]

#35

Should include CTRL-Q and CTRL-S, as I've encountered students who accidentally hit CTRL-S instead of CTRL-X and then stare at a hung terminal wonder WTF just happened.

I'm of the opinion that those should just be disabled these days.

Aside from the occasional AMD motherboard that has a very slow scrolling non-text-mode framebuffer, Ctrl-Q and Ctrl-S aren't so useful with the GUI terminal programs or console terminals nowdays.

Re: Linux Terminal Tools [pdf]

#36
The secret that I never see brought up on any of the linux command line tools is "esc + ." - It's by far one of the most valuable tricks I've learned, it will insert the last thing from the last command

ls /foo/bar/this_is_the_file.txt

cat "esc + ."

which expands to

cat /foo/bar/this_is_the_file.txt

Re: Linux Terminal Tools [pdf]

#37
post #36

The secret that I never see brought up on any of the linux command line tools is "esc + ." - It's by far one of the most valuable tricks I've learned, it will insert the last thing from the last command ls /foo/bar/this_is_the_file.txt cat "esc + ." which expands to cat /foo/bar/this_is_the_file.txt

wow, thank you! I did not know this. It will be very useful!

Re: Linux Terminal Tools [pdf]

#38
post #36

The secret that I never see brought up on any of the linux command line tools is "esc + ." - It's by far one of the most valuable tricks I've learned, it will insert the last thing from the last command ls /foo/bar/this_is_the_file.txt cat "esc + ." which expands to cat /foo/bar/this_is_the_file.txt

I’ve used !$ forever to substitute the last word from the previous command, but I never knew about this.

Re: Linux Terminal Tools [pdf]

#40

This function will fail when given an argument with a space, which would be quite frustrating for a beginner, which is presumably the target audience for such a document: > mcd() { mkdir -p $1; cd $1 } It should be more like: > mcd() { mkdir -p "$1"; cd "$1"; } The trailing ";" is also required in bash for oneline blocks like this. Same goes for most of the other functions on page 70. "$@", etc. Just trying to make t…

If we're being picky then you probably also want `mkdir -p -- "$1"` in case they want to create a directory named `-m`, `-v`, etc. Surprisingly `--` isn't mentioned in the mkdir manpage on my system, but it works. E.g. `mkdir -- -p` does what you'd want.

Strictly speaking you want `mkdir -p "./$1"`, although the failure modes of `--`-ing arguments aren't as immediately demonstratable as those of not deflagging them at all.
Post reply on HN