Live data from Hacker News

Mastering Bash and Terminal

blockloop.io

11–20 of 186 posts

Re: Mastering Bash and Terminal

#11
> 8. alt-w - delete the word behind of the cursor

He means “ctrl-w”. But since that only works in bash, not in Emacs or other tools with Emacs key bindings, it makes more sense to use (in his terminology) “alt-backspace”. This does the same thing, and works both in the shell and in Emacs-like environments.

Re: Mastering Bash and Terminal

#12

Rather than temporarily suspend vim to use the terminal you can get vim to suspend and resume itself with the exclamation mark command. This has the benefit of not wreaking havoc on your vim session and allowing you to read data into vim by prefixing with r. For example :!ls will execute ls and show you the result (press enter to return) :r!ls will read the result of ls in for you More usefully :r!sed -n5,10p that/ot…

If you want to use git from within vim, go no further than Fugitive.

Re: Mastering Bash and Terminal

#13
post #11

> 8. alt-w - delete the word behind of the cursor He means “ctrl-w”. But since that only works in bash, not in Emacs or other tools with Emacs key bindings, it makes more sense to use (in his terminology) “alt-backspace”. This does the same thing, and works both in the shell and in Emacs-like environments.

Ah yes. Thank you for the correction.

Re: Mastering Bash and Terminal

#14
The article is nice but a small part of it rubs me the wrong way:

> I know there are some cool newcomers out there like zsh and fish, but after trying others out I always found that some of my utilities were missing or ill-replaced.

First of all bash was first released in 1989 and zsh arrived just 1 year later so zsh is in no way a newcomer.

Secondly zsh is almost strictly a bash superset so I don't know what he was missing (or what he found "ill-replaced").

Re: Mastering Bash and Terminal

#15

Rather than temporarily suspend vim to use the terminal you can get vim to suspend and resume itself with the exclamation mark command. This has the benefit of not wreaking havoc on your vim session and allowing you to read data into vim by prefixing with r. For example :!ls will execute ls and show you the result (press enter to return) :r!ls will read the result of ls in for you More usefully :r!sed -n5,10p that/ot…

[deleted]

Re: Mastering Bash and Terminal

#16

Rather than temporarily suspend vim to use the terminal you can get vim to suspend and resume itself with the exclamation mark command. This has the benefit of not wreaking havoc on your vim session and allowing you to read data into vim by prefixing with r. For example :!ls will execute ls and show you the result (press enter to return) :r!ls will read the result of ls in for you More usefully :r!sed -n5,10p that/ot…

[deleted]

Re: Mastering Bash and Terminal

#17
I recommend to install mc (Midnigth Commander) and bash-completion (if bash is your shell of choice) as first terminal tools.

mc allows to explore system efficiently while not standing in my way, because I can always press ctrl-O and get my shell back.

bash-completion saves time on typing of commands.

Other tools I install often are htop (better ps) and strace.

Re: Mastering Bash and Terminal

#18
post #14

The article is nice but a small part of it rubs me the wrong way: > I know there are some cool newcomers out there like zsh and fish, but after trying others out I always found that some of my utilities were missing or ill-replaced. First of all bash was first released in 1989 and zsh arrived just 1 year later so zsh is in no way a newcomer. Secondly zsh is almost strictly a bash superset so I don't know what he was…

I wasn't so much commenting on the release date when I said "newcomers." Mostly commenting on my personal experience. I've been using bash for a long time and only recently have I seen zsh get so popular. It's entirely possible that only the people I know have only recently taken an interest in it.

I would have to run zsh again to remember the pieces that I didn't like. I might have been able to configure my way around it, but I do remember things not working as I expected them to.

Re: Mastering Bash and Terminal

#19
Regarding macOS and bash, it is slightly remiss of the article to not at least mention that the version of bash in macOS is

1. Ancient.

2. Will most likely never be updated by Apple

(Most GNU- and Linux-based systems, and also Windows, on the other hand, continue to use the latest versions.)

Re: Mastering Bash and Terminal

#20
post #14

The article is nice but a small part of it rubs me the wrong way: > I know there are some cool newcomers out there like zsh and fish, but after trying others out I always found that some of my utilities were missing or ill-replaced. First of all bash was first released in 1989 and zsh arrived just 1 year later so zsh is in no way a newcomer. Secondly zsh is almost strictly a bash superset so I don't know what he was…

I wasn't so much commenting on the release date when I said "newcomers." Mostly commenting on my personal experience. I've been using bash for a long time and only recently have I seen zsh get so popular. It's entirely possible that only the people I know have only recently taken an interest in it. I would have to run zsh again to remember the pieces that I didn't like. I might have been able to configure my way arou…

zsh was quite popular when I first went spelunking in *NIX-land (2005). oh-my-zsh, which was a decent boost to zsh popularity, seems to have been around since 2009 (http://ohmyz.sh/).

zsh has always been held back by the "default browser"-syndrome: Linux and Mac OS both come with "good enough" default shells, so few people actually want to go through the effort of switching.

Especially since there is a bit of a learning curve to becoming more productive with zsh than you already are with bash.

Post reply on HN