Live data from Hacker News

Ask HN: Best Command-Line Applications?

news.ycombinator.com

151–160 of 393 posts

Re: Ask HN: Best Command-Line Applications?

#152

I wonder if there's any 2FA code storing/generating cli application? I know they aren't supposed to be used like that but storing them all on just a phone doesn't seem wise in the long run. Might be useful while building some automated scripts as well. _edit_ oathtool seems promising (needs to be paired with something to manage and crypt the keys tho) http://www.nongnu.org/oath-toolkit/oathtool.1.html

I use totp-cli:

https://github.com/WhyNotHugo/totp-cli

Re: Ask HN: Best Command-Line Applications?

#153

I wonder if there's any 2FA code storing/generating cli application? I know they aren't supposed to be used like that but storing them all on just a phone doesn't seem wise in the long run. Might be useful while building some automated scripts as well. _edit_ oathtool seems promising (needs to be paired with something to manage and crypt the keys tho) http://www.nongnu.org/oath-toolkit/oathtool.1.html

If you use pass as a password manager, you can use pass-otp to keep the 2fa keys.

Re: Ask HN: Best Command-Line Applications?

#154
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…

hahah I have gs and gb(branch), just because I'm just constantly typing them(sometimes for no reason at all), others I end up typing the full commands tho

Re: Ask HN: Best Command-Line Applications?

#155
I am getting fonder and fonder of xargs. It basically reads some input and appends it to a pre-supplied string. Then executes the newly created string as a command.

Trivial example:

    ls -1 | xargs -L1 echo processing 

I am finding it quite useful to load and delete a bunch of netapp volume snapshots in a single line:

    ssh netappuser@netapphost volume snapshot show $volname | awk '/selector_pattern/{print $1}' | xargs -L1 ssh netappuser@netapphost volume snapshot delete $volname

Re: Ask HN: Best Command-Line Applications?

#157
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’ve been using short aliases for my most frequently used git commands for a few years now. I can’t imagine not using aliases.

  alias st='git status'
  alias dp='git diff'
  alias di='git diff --cached'
  alias aa='git add -A'
  alias cm='git commit -m'
  alias pu='git push'
Having these aliases of mine makes these actions something that you don’t need to spend any mental effort to perform at all.

I highly recommend others to define aliases that make sense to them for the most used got commands.

Mine are named the way they are because the two letter alias represents how I think of the action that the command performs:

* st - status

* dp - diff pending

* di - diff

* aa - add all

* cm - commit

If you define your aliases this way (speaking to the other readers of this thread, not the person I am replying to), you will find that the combinations become muscle memory quickly.

Notice also that unlike a lot of other people including the person I am replying to, my aliases are not prefixed with “g”. Again this boils down to your personal way of thinking. I’ve used other version control systems before, switched to git several years ago, and use git pretty much exclusively. I am of course aware at all times that I am working with git, but at the same time when I think of actions to perform, I don’t think of them as “git this or that”, I only think of the “this or that” part. If that makes sense :P

But yeah, find aliases that work and make sense for you.

Re: Ask HN: Best Command-Line Applications?

#158
post #78

supmua. https://github.com/sup-heliotrope/sup beats mutt hands down. groups emails by tags instead of folders. and it allows to open multiple views at once, keeping state in each. it also supports saved searches as a view. it's not actively maintained right now, but it is stable. i haven't had any problems yet. sup is the ancestor of the notmuch libraries which can be integrated into mutt. but i don't know how well t…

quoting https://notmuchmail.org/notmuch-mutt/

> notmuch-mutt, which will create a "virtual" maildir folder with search results whenever a search is made. The upside is that you can search all your folders simultaneously; the downside is that your modifications in the results listing do not carry over, also having to switch folders comes with some more annoyances.

sup does not have that problem. i have used mutt for more than a decade. switching to sup was a revelation. i would really love to see any alternatives that can compete with it.

greetings, eMBee.

Re: Ask HN: Best Command-Line Applications?

#159
post #155

I am getting fonder and fonder of xargs. It basically reads some input and appends it to a pre-supplied string. Then executes the newly created string as a command. Trivial example: ls -1 | xargs -L1 echo processing I am finding it quite useful to load and delete a bunch of netapp volume snapshots in a single line: ssh netappuser@netapphost volume snapshot show $volname | awk '/selector_pattern/{print $1}' | xargs -L…

With xargs (and find), I wish I would've found this sooner:

find test -print0 | xargs -0 file

"This allows file names that contain newlines or other types of white space to be correctly interpreted by programs that process the find output. This option corresponds to the -0 option of xargs."

Re: Ask HN: Best Command-Line Applications?

#160
I wrote a Python cli tool for getting the git status/history over multiple local repositories. I am often working across several repos on a single project, but generally I find it useful to see what updates are available, and also what my team are up to.

https://github.com/benp44/git-bulk-toolkit

shameless plug alert

Post reply on HN