Live data from Hacker News

Show HN: Get help on any Linux command by typing 'howdoi –' in your terminal

github.com

21–30 of 59 posts

Re: Show HN: Get help on any Linux command by typing 'howdoi –' in your terminal

#21
Instead of this, I keep a permanent log of every shell command I ever typed and have a handy alias to keep through it.

It also keeps track of the directory a command was run from, so I can limit my search. That way if I ever want to get back into a project I was working on long ago, I can just grep for commands run from that directory.

Not only that, but I can use it to cd to directories quickly. So if I was working under a huge p 10 level deep directory path, I have a alias that will match a string and cd into the last matching path in the permanent history file.

Not only that, but I can also search and then choose and rerun a command in the history, and also edit before rerunning it.

Re: Show HN: Get help on any Linux command by typing 'howdoi –' in your terminal

#22
post #21

Instead of this, I keep a permanent log of every shell command I ever typed and have a handy alias to keep through it. It also keeps track of the directory a command was run from, so I can limit my search. That way if I ever want to get back into a project I was working on long ago, I can just grep for commands run from that directory. Not only that, but I can use it to cd to directories quickly. So if I was working…

How do I get this?

Re: Show HN: Get help on any Linux command by typing 'howdoi –' in your terminal

#26
post #22
post #21

Instead of this, I keep a permanent log of every shell command I ever typed and have a handy alias to keep through it. It also keeps track of the directory a command was run from, so I can limit my search. That way if I ever want to get back into a project I was working on long ago, I can just grep for commands run from that directory. Not only that, but I can use it to cd to directories quickly. So if I was working…

How do I get this?

I have similar setup (infinite history, remember directory, shell session, ...), and then ctrl-r runs fzf that find the command first in this session, then in the same directory, then in the rest. I already hinted about that setup here:

https://news.ycombinator.com/item?id=22504950

Note, that just logging your directory, time and command in text file is great help, since if you don't remember something, you can just open the file and find what you need.

Re: Show HN: Get help on any Linux command by typing 'howdoi –' in your terminal

#27

$ curl cheat.sh/tar $ curl cheat.sh/ssh $ curl cheat.sh/awk

I made a small function to use "cheat" and it helps a lot to find examples of how to use some Linux command when I'm stuck:

function cheat() { curl cht.sh/$1 }

Post reply on HN