Linux Terminal Tools [pdf]
41–50 of 57 posts
Re: Linux Terminal Tools [pdf]
#42Should 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]
#43Re: Linux Terminal Tools [pdf]
#44The 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
do you type the literal characters "esc + ." or do you press CTRL+[ then period, or do you push the escape key, then period, or do you push escape and period at the same time?
I'm not at a terminal to try any of this and find out for myself.
Re: Linux Terminal Tools [pdf]
#45Earlier quoted context omitted.
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.
please work on separating the semantics of someone's statement from the pragmatics. don't bother with the "how they phrased it" bit, and instead try to focus on the "what are they trying to say" part more. you may be, like I did all too often in my youth, over-emphasizing English correctness, missing the message being communicated entirely.
maybe you're not doing that! maybe you are. only you can know for sure. if you are, then try to work on that. it will help you communicate and it will help others communicate with you. we all grow as people over time, and no one is flawless, and that's fine. just try to be better every day.
Re: Linux Terminal Tools [pdf]
#46Earlier quoted context omitted.
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.
The only solution is for users to add the "./" prefix themselves when the path begins with "-", because many BSD userspaces don't support "--" as a marker to stop option parsing. Maybe that doesn't matter for a document with Linux in the title, but given the popularity of macOS for doing Linux development, I would still err on the side of supporting the BSDs for such things. Never mind that support for "--" outside GNU is very spotty, even on Linux.
There is no point, in my opinion, in trying to be smart in small shell helper functions. It should just do a simple, relatively foolproof series of commands, and usually, bail early on error. But the intersection of `mkdir -p` failures and `cd` successes is tiny, so I didn't even bother muddying the waters by suggesting another alteration to use `&&`.
Re: Linux Terminal Tools [pdf]
#47The 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
ok this is going to sound stupid, but I don't care. learning time, for me. do you type the literal characters "esc + ." or do you press CTRL+[ then period, or do you push the escape key, then period, or do you push escape and period at the same time? I'm not at a terminal to try any of this and find out for myself.
Re: Linux Terminal Tools [pdf]
#48The 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
Another no-brainer imho is editing you /etc/inputrc or your $HOME/.inputrc and bind keys (usually PgUp and PgDn) to history-search-backward and history-search-forward.
From there you can navigate your history like with the arrows, but it will only consider lines that starts with the string that is currently on the command line.
It is a MUST.
Re: Linux Terminal Tools [pdf]
#49The 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 agree, and some days ago, in another thread, I got +10 on my comment detailing this shortcut. Another no-brainer imho is editing you /etc/inputrc or your $HOME/.inputrc and bind keys (usually PgUp and PgDn) to history-search-backward and history-search-forward. From there you can navigate your history like with the arrows, but it will only consider lines that starts with the string that is currently on the command…
Re: Linux Terminal Tools [pdf]
#50The 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