Re:Show HN: Unix tool that visualizes shell commands usage
by caterama on Friday February 26, 2021 @07:18PM
(#26281411)
Pretty cool terminal visualizations, but tbh straight unix tools allow you to do this (might be different than 4th column for you depending on history format):
Re:Show HN: Unix tool that visualizes shell commands usage
by atleta on Friday February 26, 2021 @07:29PM
(#26281476)
Add -n to the second sort to actually get a numerically (as opposed to lexically) sorted list. Also, here (using bash on linux) awk needs $2 instead of $4.
It doesn't catch the pipes, because you are parsing the command lines as entered, and you filter for a single parameter from each.
Re:Show HN: Unix tool that visualizes shell commands usage
by ReaLNero on Saturday February 27, 2021 @02:05AM
(#26283269)
Interesting command usage. One tip I'd offer is to use a `trash` command instead of `rm`. Unix doesn't usually offer it, but installing is as simple as `apt install trash-cli`.
You've gotten lucky 674 times by not `rm`-ing the wrong thing.
Re:Show HN: Unix tool that visualizes shell commands usage
by bxparks on Friday February 26, 2021 @06:01PM
(#26280866)
If you use bash (or zsh, and maybe others), hit ^L (control-L) to clear the screen. From the bash(1) manual:
clear-screen (C-l)
Clear the screen leaving the current line at the top of the screen. With an argument, refresh the current line without clearing the screen.
Re:Show HN: Unix tool that visualizes shell commands usage
by stevekemp on Saturday February 27, 2021 @06:34AM
(#26284176)
A raw "cd" with no arguments will take you back to your home-directory. Of course "~" is one less character to type, but on the off-chance you didn't know.
Re:Show HN: Unix tool that visualizes shell commands usage
by aemreunal on Saturday February 27, 2021 @12:35AM
(#26282925)
I clear the screen a lot, but I use Cmd+K to clear the whole Terminal.app screen or Cmd+L to clear the last command (and its output) on Mac, rather than using the `clear` command. I use Bash, not sure if it works on other terminal emulators.
Re:Show HN: Unix tool that visualizes shell commands usage
by breck on Friday February 26, 2021 @04:47PM
(#26280231)
YES!!! I've been waiting for someone to do this for a decade or more.
This + https://tldr.sh/ and the command line will be so much easier for me (but especially beginners!).
With your tool, having an easy way to copy and paste your personal usage into some central website and then have some scripts would be a great thing to show aggregates.
You could probably just create a single new repo and people could send PR's with their usage dumped to CSV (and they could remove any person info manually before). Then you just have a script that reads those CSVs and prints a nice web page with summary data.
`history | awk '{print $4}' | sort | uniq -c | sort`
Also, I'm noticing this won't catch anything in pipes otherwise I'd expect to see less and xargs pretty high up.It doesn't catch the pipes, because you are parsing the command lines as entered, and you filter for a single parameter from each.
You've gotten lucky 674 times by not `rm`-ing the wrong thing.
Any ideas?
FYI,
go build
./tsukae
clear-screen (C-l) Clear the screen leaving the current line at the top of the screen. With an argument, refresh the current line without clearing the screen.
Not as fancy as some other aliases I see here but does the (basic) trick.
This + https://tldr.sh/ and the command line will be so much easier for me (but especially beginners!).
With your tool, having an easy way to copy and paste your personal usage into some central website and then have some scripts would be a great thing to show aggregates.
You could probably just create a single new repo and people could send PR's with their usage dumped to CSV (and they could remove any person info manually before). Then you just have a script that reads those CSVs and prints a nice web page with summary data.