Live data from Hacker News

Linux Terminal Tools [pdf]

ketancmaheshwari.github.io

11–20 of 57 posts

Re: Linux Terminal Tools [pdf]

#11

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…

it probably makes sense to use "&&" instead of ";": if mkdir -p fails cd is still being executed.

Re: Linux Terminal Tools [pdf]

#12
post #7

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…

a beginner would not likely quote the argument, so the point is moot... besides, what kind of savage wants a directory name with spaces?

> a beginner would not likely quote the argument, so the point is moot...

But a beginner could still tab-complete file names and get them automatically backslashed.

Re: Linux Terminal Tools [pdf]

#17

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.

It's a learning moment for users who press Ctrl-s to save their work due to muscle memory from other environments. That's when they get a crash course in Ctrl-q and screen/tmux.

Re: Linux Terminal Tools [pdf]

#18
This! Super helpful. Thanks! I have worked with the command line for 20+ years, still I’ve learnt a ton. Now if this could be compiled on one or two pages in small print, it would make an excellent cheat sheet!

Re: Linux Terminal Tools [pdf]

#20
post #7

Earlier quoted context omitted.

a beginner would not likely quote the argument, so the point is moot... besides, what kind of savage wants a directory name with spaces?

> a beginner would not likely quote the argument, so the point is moot... But a beginner could still tab-complete file names and get them automatically backslashed.

[deleted]
Post reply on HN