I really enjoy using a command-line interface instead of a graphical user interface, and was wondering if anyone had any solid recommendations for applications that one can use in a terminal window.
Some great contributions here ... some that are missing (or at least scarce) which deserve more attention:
units - for a broad range of conversions without having to resort to Wolfram Alpha or a search engine bc -l - the -l option really empowers this awesome little calculator. mpv - awesome media player - point it at a media URL (it uses youtube-dl in the background, so perfect for viewing or listening with no ads,) but can also play from open directories / SMB shares, online radio, Play a series of images as video, Access any FFmpeg/Libav libavformat protocol or filter (including generating tones and images, and more. And once it's playing, has great interactive keyboard controls for many useful functions.
Agreed. >bc -l - the -l option really empowers this awesome little calculator. Right. Since bc is a Unix filter, you can also pipe expressions into it, to be evaluated, so it can be used in general Unix pipelines. E.g.:
echo *arithmetic_expression* | bc -l
and the output comes on stdout, so it can be further piped.
Edit: You have to quote any shell special characters in arithmetic_expression with single quotes, or better, just enclose the entire arithmetic_expression in single quotes. If asterisk (for multiplication) is not quoted, for example, it will be treated as a filename wildcard instead, and likely lead to an error. A wrong and a right example:
For working on servers, tmux + mosh is a killer combination: mosh makes your connection resilient to network issues and tmux gives you (back) scrollback and cross-session persistence.
mutt is hard to beat as an email client and circe (an emacs package) + znc on a digital ocean instance or equivalent makes for a great persistent irc session.
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 HEAD \*"
alias gcp="git cherry-pick"
alias gcpc="git cherry-pick --continue"
alias gcpa="git cherry-pick --abort"
A few hundred instances of "gs" in my .zhistory :)
alias ..="cd .."
alias ..2="cd ../.."
# ... you get the idea, mine goes up to 5
function mkcd () { mkdir -p "$@" && eval cd "\"\$$#\""; }
alias h="history|grep"
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
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.
SCM Breeze has aliases like that, plus a bunch of other convenient things like numbered shortcuts for branches and files: https://github.com/scmbreeze/scm_breeze
Since git is by far the command a lot of people type the most, this shell comes in really handy. It supports all regular git aliases, has autocompletion, and you can set default commands to be run when you just press return. It's amazing how much typing it saves.
I used to use ag (the silver searcher) [1] before, and `ag` was practically a muscle memory to me, but then I came across ripgrep and it was so much faster. I've now installed a static binary of ripgrep in every machine I have SSH access to. [1] https://github.com/ggreer/the_silver_searcher
Comments (385) 158 threads
Earlier commentsunits - for a broad range of conversions without having to resort to Wolfram Alpha or a search engine
bc -l - the -l option really empowers this awesome little calculator.
mpv - awesome media player - point it at a media URL (it uses youtube-dl in the background, so perfect for viewing or listening with no ads,) but can also play from open directories / SMB shares, online radio, Play a series of images as video, Access any FFmpeg/Libav libavformat protocol or filter (including generating tones and images, and more. And once it's playing, has great interactive keyboard controls for many useful functions.
Agreed.
and the output comes on stdout, so it can be further piped.>bc -l - the -l option really empowers this awesome little calculator.
Right. Since bc is a Unix filter, you can also pipe expressions into it, to be evaluated, so it can be used in general Unix pipelines. E.g.:
Edit: You have to quote any shell special characters in arithmetic_expression with single quotes, or better, just enclose the entire arithmetic_expression in single quotes. If asterisk (for multiplication) is not quoted, for example, it will be treated as a filename wildcard instead, and likely lead to an error. A wrong and a right example:
mutt is hard to beat as an email client and circe (an emacs package) + znc on a digital ocean instance or equivalent makes for a great persistent irc session.
Here are my top commands by frequency of use:
total is of ~16k history lines... this means one in ever 4 commands I type is git! Wow I didn't know that. Probably `git status`...Aliases in my ~/.gitconfig:
No need to install oh-my-zsh you can just take the file or cherry pick (!) the useful ones.
I may drop oh-my-zsh completely and just set up zsh with the small subset of plugins I use.
[1] https://github.com/robbyrussell/oh-my-zsh/tree/master/plugin...
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.
Since git is by far the command a lot of people type the most, this shell comes in really handy. It supports all regular git aliases, has autocompletion, and you can set default commands to be run when you just press return. It's amazing how much typing it saves.
I used to use ag (the silver searcher) [1] before, and `ag` was practically a muscle memory to me, but then I came across ripgrep and it was so much faster. I've now installed a static binary of ripgrep in every machine I have SSH access to.
[1] https://github.com/ggreer/the_silver_searcher
https://beyondgrep.com/feature-comparison/
https://github.com/beyondgrep/website/issues
All comments shown.
Couldn't load more comments. Check your connection and try again.