Live data from Hacker News

Linux Terminal Tools [pdf]

ketancmaheshwari.github.io

1–10 of 57 posts

Re: Linux Terminal Tools [pdf]

#2
103 pages of Linux commandline goodness! Nice overall reference, especially the parts on regex and awk.

Table of Contents (for those who hate PDFs):

Part 1: Overview and Logistics

• Part 2: Basics

• Part 3: Streams, pipe and redirection

• Part 4: Classic Tools: find, grep, awk, sed

• Part 5: Session Management: tmux

• Part 6: ssh: config and tunneling

• Part 7: Secure Communication with GnuPG

• Part 8: Bash Tools

• Part 9: Program Development Tools

• Part 10: Miscellaneous Utilities

• Summary

• Practice and Exercises (if time permits else Offline)

Re: Linux Terminal Tools [pdf]

#5
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 the learning experience less frustrating, not trying to tear down the effort :)

Re: Linux Terminal Tools [pdf]

#6

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…

Ah thank you! I will fix it.

Re: Linux Terminal Tools [pdf]

#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?

Re: Linux Terminal Tools [pdf]

#8
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?

(looks at all his directories which are written as phrases and ...)

[raises hand] This type of savage?

Re: Linux Terminal Tools [pdf]

#9
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?

True, they'd have to learn how to use arguments with spaces in the shell -- but this won't necessarily happen near the time they add mcd to their .bashrc, which may lead to frustration with customization, and stifle the desire to learn. Something to be avoided when it is simple and easy to do so.
Post reply on HN