Live data from Hacker News

Mastering Bash and Terminal

blockloop.io

181–186 of 186 posts

Re: Mastering Bash and Terminal

#181

Instead of ctrl-z and bg why not just do # & to push it to the background.

I don't know if you can bring a process back to the foreground using the

it does work. I just tried it.

#> watch -n 1 dmesg & #> fg -- brought it back

Re: Mastering Bash and Terminal

#182
post #176

Earlier quoted context omitted.

zsh never claimed it was compatible with bash. I'm not sure where you got that impression from. Maybe you're thinking of sh -- the bourne shell -- which zsh is in fact compatible with (as long as you limit your scripts to the bourne shell subset of zsh).

I'm not sure, where I've read it specifically, but it was a feature I was looking fore before switching to zsh about 5 years ago. What I found now is this: https://wiki.archlinux.org/index.php/zsh Anyways. The core point is that compatibility often means compatible in 90%-99% of the cases. It's really really hard to be 100% compatible, which also requires one to emulate bugs etc.

The web page you link to is mistaken. The zsh command "emulate sh" does not emulate bash. As the name says, it emulates sh, which is the bourne shell -- not bash.

Re: Mastering Bash and Terminal

#184
> Now that we know we don't need the up and down arrow keys, what about the left and right? Unfortunately, these keys are still needed for single character movements...

What? No. Use Ctrl-f and Ctrl-b. I use this probably more than any other readline shortcut.

Ctrl-h for backspace, Ctrl-d for delete. Half my keyboards don't even have arrow keys and I don't miss them.

Re: Mastering Bash and Terminal

#185

Earlier quoted context omitted.

There is Ctrl-y for pasting deleted strings, which goes along very well with these commands: Ctrl-k delete to end of line Ctrl-u delete to beginning of line Alt-d delete to end of word Ctrl-w delete to beginning of word Alt-Backspc same Bash keybindings behave like Emacs by default, hence every time you invoke one of these, it will put the string into a buffer, which can be later pasted using Ctrl-y. This is very use…

"\e[A": history-search-backward "\e[B": history-search-forward These have to go in `~/.inputrc`, right?

That's right! Sorry for the late reply.
Post reply on HN