Live data from Hacker News

Ask HN: Best Command-Line Applications?

news.ycombinator.com

41–50 of 393 posts

Re: Ask HN: Best Command-Line Applications?

#42
post #25

youtube_dl an ffmpeg would be my top two in terms of power. Here are my top commands by frequency of use: 4421 git 952 open 936 vim 908 cd 603 ls 566 grep 533 cp 429 rm 414 mv 250 atom 247 pip 233 mkdir 223 fab 163 docker 130 touch 128 find 123 youtube-dl 113 python 103 ssh 100 cat 99 wget 81 pytest 75 brew total is of ~16k history lines... this means one in ever 4 commands I type is git! Wow I didn't know that. Prob…

I use git so much that I made these aliases in zsh: alias g="git show" alias gh="git show HEAD" alias gs="git status" alias gl="git log" alias gco="git checkout" alias gd="git diff" alias gbl="git branch -v" alias gbd="git branch -D" alias gri="git rebase --interactive" alias grc="git rebase --continue" alias gra="git rebase --abort" alias gst="git stash" alias gsta="git stash apply" alias gx="gco -- \*; git reset HE…

I find that...

    alias glol="git log --oneline"
...comes in handy as well, and it's fun to type.

Re: Ask HN: Best Command-Line Applications?

#43
I am always impressed by the usefulness of the git command line. If you wanted to write a GUI for it you usually would have a library to link to but the GUIs (e.g SourceTree) I have seen use the command line and still get good performance.

Another one is ffmpeg. A ton of tools are built on it.

For photographers exiftool is great.

Re: Ask HN: Best Command-Line Applications?

#44
post #40

My top 4: 40.2% ls 22.8% cd 15.6% python 3.6% nano Since no one's mentioned it yet: I don't necessarily think nano is great, but it's always there and it opens immediately. Almost all small, quick edits I make (where opening VSCode/Emacs/whatever doesn't make sense) are done in nano. Pretty useful.

Nano simply and efficiently gets the job done in 70% of cases.

Nano Vim Xdg youtube-dl wttr git curl top watch

Re: Ask HN: Best Command-Line Applications?

#45

Earlier quoted context omitted.

> tr - lets you deal with line endings, which sed can't I'm not sure what you mean by "deal with line endings", but sed can operate across multiple lines. https://www.gnu.org/software/sed/manual/html_node/Text-searc...

I mean directly operating on the line ending itself. e.g. remove all lines or replace `\n` with the record separator, etc.

Like so?

    % echo 'one\ntwo\nthree' | sed -e 's,$, four,'
    one four
    two four
    three four

Re: Ask HN: Best Command-Line Applications?

#46

If you need to handle XML, xmlstarlet ( http://xmlstar.sourceforge.net ) is fantastic, and much more powerful than the standard line-oriented tools like sed and awk for this task. Similarly jq ( https://stedolan.github.io/jq/ ) for JSON data is great.

And to round out the set, xsv (https://github.com/BurntSushi/xsv/) is a powerful toolkit for CSV.

Re: Ask HN: Best Command-Line Applications?

#47

I'm not big on applications, period. Activities should be decomposed (or at least decomposable) into individual actions that I can stitch together in the shell.

Aren’t those individual actions still applications? I don’t know what you mean?

There's a frequent (but by no means universal) distinction drawn between "applications" and "utilities". In the former case, you have repeated interaction with a single process, typically with some measure of "ownership" of its display port. On the other hand, a utility typically does a single thing, produces some output, and then exits.

Re: Ask HN: Best Command-Line Applications?

#48
post #27

fzf is awesome. I use it in vim and bash. https://www.tecmint.com/fzf-fuzzy-file-search-from-linux-ter... ---- I use the Silver Searcher all the time. Very fast. https://github.com/ggreer/the_silver_searcher ---- tig, a text mode interface for git. https://github.com/jonas/tig

It's been mentioned previous, but you should check out ripgrep - it's even faster than Silver Searcher a lot of the time

https://github.com/BurntSushi/ripgrep

Re: Ask HN: Best Command-Line Applications?

#49

If you aren't using tmux or screen, you probably should be, especially over SSH sessions. They allow you to have multiple consoles open and switch between them, split window, and disconnect from SSH and then reconnect with all your things still open and running (as long as the server stayed running).

I use some scripts around screen (and tmux would do the job at least as well, just haven't had reason enough to switch) to manage contexts for my shells. The key is that that process will be the parent of any shells I spawn in contained windows, and so if I set an environment variable (I use SESSION) before kicking off screen it will be inherited, and visible in my bashrc. This lets me set up a lot of context specific things - path and functions and aliases - but the single best thing about it is a separate bash history per context.
Post reply on HN