Live data from Hacker News

Show HN: Oh-heck, a terminal command for when you forget other terminal commands

oh-heck.dev

61–70 of 132 posts

Re: Show HN: Oh-heck, a terminal command for when you forget other terminal commands

#61
post #58

I have a simpler solution. The use case is not precisely the same, but for many scenarios, it's effectively the same. Simply, like many, I have bash set up to record commands in .bash_history. I have it flush all the time, so .bash_history is always current. # keep persistent bash history across sessions export PROMPT_COMMAND='history -a;history -n' export HISTCONTROL=ignoredups shopt -s histappend Next, I have a sim…

Yep, history is my go to Rosetta Stone for remembering other commands.

Anytime I sign into a system I have not signed into for a long time. The first thing I do is save the history file before I start working. Many times it has saved the day when you get stuck: where did I store that config? what was the command to restart the server?

Re: Show HN: Oh-heck, a terminal command for when you forget other terminal commands

#62

I have a simpler solution. The use case is not precisely the same, but for many scenarios, it's effectively the same. Simply, like many, I have bash set up to record commands in .bash_history. I have it flush all the time, so .bash_history is always current. # keep persistent bash history across sessions export PROMPT_COMMAND='history -a;history -n' export HISTCONTROL=ignoredups shopt -s histappend Next, I have a sim…

(Unrelated to original post) That only helps if you know the keywords curl and json. My actual problem in the past has repeatedly been that I a) forget how the graphical file manager on my system is called because I use it a couple of times per year (dolphi, konqueror, thunar, whatever...) and b) I use i3 or xmonad and don't have a "start menu" to just browse.

I think I should just put a symlink called explorer.exe in my ~/bin/ and then I know where to look ;)

Re: Show HN: Oh-heck, a terminal command for when you forget other terminal commands

#63
post #37

Earlier quoted context omitted.

Apropos has the compelling feature that I get to feel clever for knowing the word.

I believe man -k just runs apropos.

Right. There's often a tension between features and ease of use.

Re: Show HN: Oh-heck, a terminal command for when you forget other terminal commands

#64
post #18

Some people seem to be unaware of apropos too (old text based cli tool). $ apropos network interfaces (5) - network interface configuration for ifup and ifdown aseqnet (1) - ALSA sequencer connectors over network byteorder (3) - convert values between host and network byte order ctstat (8) - unified linux network statistics

I hate that it spews so much irrelevant things. Run "apropos directory" on macos and see if you can find "ls" between

create_automation_image_overlay(8), -(8) - ."====================== create_automation_image_overlay overlay automation image content onto another directory ." ."

and

CPANPLUS::Internals::Source::Memory(3pm) - In memory implementation n .SS "$cb->_|_memory_retrieve_source(name => $name, [path => $path, uptodate => BOOL, verbose => BOOL])" .SS "$cb->_|_memory_retrieve_source(name => $name, [path => $path, uptodate => BOOL, verbose => BOOL])" Subsection "$cb->__memory_retrieve_source(name => $name, [path => $path, uptodate => BOOL, verbose => BOOL])" This method retrieves a storabled tree identified by $name. It takes the following arguments: name" 4 Item "name" The internal name for the source file to retrieve. uptodate" 4 Item "uptodate" A flag indicating whether the file-cache is up-to-date or not. path" 4 Item "path" The absolute path to the directory holding the source files. verbose" 4 Item "verbose" A boolean flag indicating whether or not to be verbose. Will get information from the config file by default. Returns a tree on success, false on failure. n .SS "$cb->_|_memory_save_source([verbose => BOOL, path => $path])" .SS "$cb->_|_memory_save_source([verbose => BOOL, path => $path])" Subsection "$cb->__memory_save_source([verbose => BOOL, path => $path])" This method saves all the parsed trees in storabled format if Storable is available. It takes the following arguments: path" 4 Item "path" The absolute path to the directory holding the source files. verbose" 4 Item "verbose" A boolean flag indicating whether or not to be verbose. Will get information from the config file by default. Returns true on success, false on failure

Re: Show HN: Oh-heck, a terminal command for when you forget other terminal commands

#65
post #32
post #18

Some people seem to be unaware of apropos too (old text based cli tool). $ apropos network interfaces (5) - network interface configuration for ifup and ifdown aseqnet (1) - ALSA sequencer connectors over network byteorder (3) - convert values between host and network byte order ctstat (8) - unified linux network statistics

man -k has been working just fine for me for 30+ years

TIL about the -k option. Whoa.

Re: Show HN: Oh-heck, a terminal command for when you forget other terminal commands

#67

Hey guys, I've created a really small tool that converts natural language into terminal commands using GPT3. To my chagrin, I seem to have a pathological inability to remember commands so I'm hoping this may help others suffering from such a terrible affliction.

When I first read this comment I assumed it was someone sarcastically pretending to be the creator and not the actual creator, and I thought, what a dick... LOL

Looks neat! I've already been using github copilot which I've found brings some more joy into coding (even when it's a little off).

Re: Show HN: Oh-heck, a terminal command for when you forget other terminal commands

#68

I have a simpler solution. The use case is not precisely the same, but for many scenarios, it's effectively the same. Simply, like many, I have bash set up to record commands in .bash_history. I have it flush all the time, so .bash_history is always current. # keep persistent bash history across sessions export PROMPT_COMMAND='history -a;history -n' export HISTCONTROL=ignoredups shopt -s histappend Next, I have a sim…

You can use McFly instead: https://github.com/cantino/mcfly

Re: Show HN: Oh-heck, a terminal command for when you forget other terminal commands

#69

I have a simpler solution. The use case is not precisely the same, but for many scenarios, it's effectively the same. Simply, like many, I have bash set up to record commands in .bash_history. I have it flush all the time, so .bash_history is always current. # keep persistent bash history across sessions export PROMPT_COMMAND='history -a;history -n' export HISTCONTROL=ignoredups shopt -s histappend Next, I have a sim…

Nice work, I wanted to add how I deal with this. first my .bashrc Is setup to append and history is set to 100,000 lines.

Most importantly I have an alias set up for the letter h , that greps, case insensitive .bash_history. ( grep -i $1 .bash_history ).

So typing in the cli: # h awk gives me all my awk commands.

And second , as a global history search across all my VMs/instances, (as I already make extensive use of splunk and splunks universal forwarder log forwarding app/tool) , all vms have their splunk universal forwarder service set to send any updates to .Bash_history to my central spunk server. thus I’m able to globally search the bash history from any VM globally, going back forever (I search that via the splunk web gui i mean). All works great!

Post reply on HN