Live data from Hacker News

Ask HN: What are your favorite one-liner shell commands you use?

news.ycombinator.com

41–44 of 44 posts

Re: Ask HN: What are your favorite one-liner shell commands you use?

#41

Not really a shell one liner, but ctrl+r (a readline command to do an incremental search backwards through history) is something that has been present on every shell I've used for decades without realising it, One day I decided to take the time to read all the magic readline commands because I wanted a way to quickly edit the N-th argument of a command with lots of arguments, and there were way too many of them. Ther…

No need to be fancy. These are super practical! ctrl+r is a lifesaver once it clicks, and cd - is such a small thing that makes moving around so much smoother.

Re: Ask HN: What are your favorite one-liner shell commands you use?

#42
post #34

I use pgrep -fl instead of ps to find running processes by name. For complex one liners, I keep them in a simple txt file with a brief description so I can find them later when I need to use them again.

Smart move with pgrep -fl—so much cleaner than piping through ps | grep. And keeping a personal cheat sheet of one-liners is underrated.
Post reply on HN