Linux Terminal Tools [pdf]
21–30 of 57 posts
Re: Linux Terminal Tools [pdf]
#22This 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]
#23I switched over to powershell and the quality of life improvements have been amazing.
Re: Linux Terminal Tools [pdf]
#24Should 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.
Funny, I used to have ctrl-s muscle memory, then 10 years of primarily developing on mac got me used to cmd-s since mac keyboards are so annoying. now when i switch between mac/win/linux it's just a constant mess of pressing the wrong special key combos. Almost as bad switching between scripting languages and forgetting if a function starts with func, proc, sub, def, etc... (yes, I know you can swap special keys on mac: i tried it and it creates way more headaches than it solves.)
Re: Linux Terminal Tools [pdf]
#25This 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.
function mkcd() {
mkdir -p "$@" && cd "$1";
}
supports multiple dirs and cd to the first one mkcd a b cRe: Linux Terminal Tools [pdf]
#26Linux shells are so unbelievably painful. I switched over to powershell and the quality of life improvements have been amazing.
Re: Linux Terminal Tools [pdf]
#27Would 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 difficult to make a distinction between what's generally Unix and what's actually specifically Linux when we just call everything Linux.
Re: Linux Terminal Tools [pdf]
#28Re: Linux Terminal Tools [pdf]
#29It'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…
Re: Linux Terminal Tools [pdf]
#30This 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…
Surprisingly `--` isn't mentioned in the mkdir manpage on my system, but it works. E.g. `mkdir -- -p` does what you'd want.