logoalt Hacker News

Shell Tricks That Make Life Easier (and Save Your Sanity)

621 pointsby zdwlast Thursday at 12:28 AM263 commentsview on HN

Comments

scuff3dlast Thursday at 5:27 PM

Great write up, had to bookmark so I can go through it more later there so much good stuff in there.

For the CTRL + R tip, you can make it even better if you install fzf. Massively improves searching through history. It's worth the install just for that one feature.

Best thing I ever did as a dev was start spending more time in the terminal. Getting familiar with the tools and how they interact makes life so much easier.

chinadatalast Thursday at 5:18 PM

only the people do not use pageup and pagedown is who really know how to use shell

keyboredlast Thursday at 10:52 AM

> We’ve all been there.

Close tab.

I ought to migrate away from shell scripting and just keep the shell for interactive use. Unfortunately I have cursed myself by getting competent-ish with P. shell and Bash scripting. Meaning I end up creating maintenance headaches for my future self.

(Echoes of future self: ... so I asked an LLM to migrate my shell scripts to Rust and)

Anyway with the interactive shell stuff. Yeah the I guess Readline features are great. And beyond that I can use the shortcut to open the current line in an editor and get that last mile of interactivity when I want it. I don’t really think I need more than that?

I tried Vim mode in Bash but there didn’t seem to be a mode indicator anywhere. So dropped that.

Edit: I just tested in my Starship.rs terminal: `set -o vi`. Then I got mode indicators. Just with a little lag.

show 1 reply
quijoteunivlast Thursday at 10:05 AM

Guilty as charged

ameliuslast Thursday at 10:13 AM

What I hate is that if you start a command with a space it is not recorded in the history. This happens often when copy+pasting commands. I know you can turn it off but still ... this drives me mad.

show 1 reply
faangguyindialast Thursday at 9:07 AM

I just open, agent in tui, and ask it to do what I want and make a plan, i read the plan edit it and run it.

Simple, no need to learn any commandline these days.

I used to use arch and all, and managed many big projects. I find little value in learning new tools anymore, just feed it docs and it generated working plan most of the time

Now I've moved to coding in Haskell, which i find suits me better than wasting my time with cli and exploring what options all these cli tools have.

show 2 replies