
Command Line Tools to Break Your Dependence on the GUI - dragondax
https://www.putorius.net/5-cool-command-line-tools.html
======
cranekam
This article is awful. You're not going to "break your dependence on the GUI"
by replacing 5 things you do a few times a day with obscure, less good CLI
alternatives. What about things like manipulating files and running programs?
Aren't they the things people do with computers?

Also, bc is especially terrible. Nobody who is already "dependent on the GUI"
is going to want to know about scale= and all that. Better to use Python or
even bash (echo $((123+456)) etc)

~~~
yjftsjthsd-h
> What about things like manipulating files and running programs? Aren't they
> the things people do with computers?

I'm confused. Manipulating files and running programs is a given, isn't it?
You mean ls/cp/mv/rm-style? And running programs is... type in the name of the
program (if in $PATH) or its path (if not) and press enter. Why would anyone
bother blogging about that?

~~~
cranekam
It depends on what people use the GUI for. It's not inconceivable that people
start up gvim to make a new file (instead of cat > file) or use some bulk-
renaming tool instead of learning about shell expansions.

"Awful" was a mean description of this article. I'll fix it (edit: comment,
not fix).

~~~
yjftsjthsd-h
`vim newfile` (or gvim/nano/emacs/whatever) will create a new file. I won't
say I've never created a file with cat (handy for pasting), but it's a little
unusual.

~~~
cranekam
I usually do it when autoindent is going to make a mess of whatever I'm
pasting into the file.

------
exergy
A dictionary? I mean, that's neat and all, but not all that useful is it? I
_might_ check the weather once a day, tops. This is better solved by having a
widget on my smartphone. Same for the dictionary, and same for short google
searches too (Firefox Focus).

I had a twinge of hope that this might have been more of an introduction to
using the terminal effectively on Linux for diagnoses.

I'm new to Linux, and every time I have an issue and find a thread addressing
it, they ask for me to run a whole bunch of commands and paste a bunch of
logs. I'm happy to do that, don't get me wrong, but I rarely have the faintest
idea of what it is that I'm typing in.

~~~
tomcooks
> I rarely have the faintest idea of what it is that I'm typing in.

I suggest checking out Like Smith's beautifully assembled video guides, whom I
think has done a lot for newbies by releasing comprehensible content while
minimising the whole RTFM attitude that kept newbies away from the terminal.

But yes, also RTFM.

~~~
xwowsersx
_Luke_ Smith? Do you have a link?

~~~
tomcooks
Lukesmith.xyz I believe

------
msluyter
I love finding good command line replacements for UIs. One I've grown to rely
on a lot these days is awslogs:

[https://github.com/jorgebastida/awslogs](https://github.com/jorgebastida/awslogs)

Which allows you to stream Cloudwatch logs via a command like:

    
    
      awslogs  get <log group name> ALL --watch
    

which is cool because you can just specify the log group and get all streams
without having to dig around for the specific stream in the AWS console.

There's a python based command line HN client
([https://github.com/donnemartin/haxor-
news](https://github.com/donnemartin/haxor-news)) that's nice, although I
think the dependencies need updating (I get various conflicts if I try to
install other packages in the same venv).

For twitter, rainbowstream is nice:

[https://github.com/orakaro/rainbowstream](https://github.com/orakaro/rainbowstream)

~~~
rdrey
I can recommend `pipx` (pipx — Install and Run Python Applications in Isolated
Environments)
[https://pipxproject.github.io/pipx/](https://pipxproject.github.io/pipx/)

------
pjmlp
I love my dependence on the GUI, otherwise would still be stuck using MS-DOS.

~~~
Pete_D
If MS-DOS had enjoyed as much developer attention as the *nix command line
experience has over the past couple of decades, that might not be so bad a
prospect.

~~~
gowld
Couple? You mean 4?

~~~
liability
'Couple' is a word that in some contexts means two specifically, but in other
(informal) contexts means a small number. Generally when somebody describes
three or four things as a "couple", they're being informal and a correction
isn't warranted.

~~~
imihai1988
”but in other (informal) contexts means a small number"

Isn't there a word for that ? I'm thinking of "several". That is what I
learned in school (not a native english speaker )

~~~
OrderlyTiamat
Both "several" and "couple" are applicable. "A handful" or "some" have the
same connotation generally, and I'm sure there are many others.

------
csdvrx
Work in progress, but sixel support may be coming to mainline tmux:

git clone git://github.com/tmux/tmux

git switch sixel

git checkout b1904c9b8db514133d3372aac13b2ff0b2093cc3

This will give you the "placeholder" box for sixels in terminals that do not
support sixel (but you should use mlterm on Linux or mintty on Windows)

The upcoming feature is to replace this placeholder box by unicode art for the
sixels, cf
[https://github.com/tmux/tmux/issues/1613](https://github.com/tmux/tmux/issues/1613)
for the current discussion.

Then you will be able to break your dependency on the GUI just by using w3m
and your favorites sites, whether your terminal supports sixel or not (but it
should, it's just better!)

apt-get install libsixel1-bin

w3m -sixel -o display_image=1 google.com

Cf [https://apple.stackexchange.com/questions/244930/how-do-i-
vi...](https://apple.stackexchange.com/questions/244930/how-do-i-view-inline-
images-in-w3m/363376)

There are other apps with integrated sixel support like mikkuter for twitter,
gnuplot (there was [https://github.com/csdvrx/sixel-
gnuplot](https://github.com/csdvrx/sixel-gnuplot) , but now the sixel backend
is compiled by default in the official gnuplot-nox starting from debian-10)

At the moment, I'm working on a mutt hack rendering outlook emails with all
their included thingies (images etc) into sixels.

If someone is looking for an idea, it'd be great to have a IRC client that
replaces URL containing pictures by their sixels renditions, a bit like what
lsix does (
[https://github.com/hackerb9/lsix](https://github.com/hackerb9/lsix) )

~~~
albertzeyer
Yes. This (image support in general in Terminal emulators and Terminal
multiplexers) is currently being actively discussed here:
[https://gitlab.freedesktop.org/terminal-
wg/specifications/is...](https://gitlab.freedesktop.org/terminal-
wg/specifications/issues/12)

Many important people are there, e.g. the Tmux maintainer/developer Nicholas
Marriott, the Mintty developer, some Xterm.js developer, and others.

~~~
csdvrx
The discussions are very interesting, but I'm not sure they are going
anywhere. Sixels might win by default. It's not a bad thing. Sixels in 16m
colors are quite versatile. But let's suppose that, eventually, a better
standard for terminal image support might emerge.

Anything that can already support sixels won't be too hard to change to
support this new standard, unless it doesn't use pixels -- though it would be
neat if this standard was vector based, like ReGIS:
[https://en.wikipedia.org/wiki/ReGIS](https://en.wikipedia.org/wiki/ReGIS) \-
I want SVG in my terminal :-)

For now, sixels already work reliably for most of the things I do. So now, I
concentrate on the applications, to make sure most of my workflow can be
console based.

------
dwrodri
I'm a little late to the party, but something I've come realize recently is
that my affection towards CLI applications comes from the fact that I usually
don't have to take my hands off the keyboard.

Human hands can move very fast, faster than we can assemble cogent thoughts
thanks to muscle memory (and other things that I'm sure I'm not aware of). I
don't know if this is a universal thing, but I like it when I don't have to
think about how to get something done. I consciously picture the end goal in
my mind, and my hands just do.

Of course, I'm a sloppy typist, and still relatively unrehearsed when it comes
to working with Vim and friends. But I've been most of the standard GNU
applications long enough to realize that my brain no longer directs my hands
to interact with the keyboard for frequent simple tasks (generate a line plot
for this two column CSV, use awk to get the penultimate column of this file,
hash files in a directory to remove duplicates, open HN in a browser...).

I'm also a big sucker for working with programs that compose well with other
programs. If I had all the time and money in the world, I'd love to have more
GUI apps that explored GUI/CLI interop better. I think one example many
developers can comment on is how nice it is when you can combine CLI git
commands with git in your code editor. Sometimes, it's just easier to resolve
ugly merge conflicts with a GUI. Or there's a really weird command that
doesn't exist in your GUI so you need to type it out on the commandline.

There's definitely a lot more work to be done in this domain and I'm excited
to see how software/OS/library developers explore this in years to come.

~~~
curioussavage
I came to a similar realization which prompted me to start working on a suite
of GUI programs that are keyboard focused.

I think that is very different than an app with good keyboard shortcuts btw
which is why, for example, despite many editors having great keyboard
shortcuts I keep going back to vim. So I’m Making basic apps that are intended
to be used entirely with a keyboard and just happen to support mouse input
too.

I realize this doesn’t work well for everything but my todo app and my note
taking app should work great at least.

------
icefog
I like awk as a calculator:

    
    
        calc () { awk "BEGIN { print "$*" }" }
    
        $ calc "2^16"
        65536
        $ calc "2*16"
        32
        $ calc "2+16"
        18

~~~
gowld
[https://en.wikipedia.org/wiki/Bc_(programming_language)#Usin...](https://en.wikipedia.org/wiki/Bc_\(programming_language\)#Using_bc_in_shell_scripts)

    
    
      $ bc -l <<< 2^16
      65536
      $ bc -l <<< 2*16
      32
      $ bc -l <<< 2+16
      18

------
excalibur
I never tried googler, but I have used lynx before. Far from a productivity
boost, all it really did was help me look busy to the untrained eye while
reading HN.

------
henrikwm
You can use this CLI to plan you haircut by browsing queue times for Cutters
hair salons:

[https://github.com/draperunner/cutters](https://github.com/draperunner/cutters)

Which enables you to run:

    
    
      $ npx cutters | grep Oslo | head -3
    

to get queue times in Oslo. Made by a colleague of mine.

~~~
fowlie
Nice. I have this as an alias in my ~/.zshrc:

curl -s [https://www.cutters.no/api/salons](https://www.cutters.no/api/salons)
| jq '.data[] | select(.location.key == "oslo") | .details.estimatedWait /=
60000 | {name: .name, wait: .details.estimatedWait, serving:
.details.numberOfServing, waiting: .details.numberOfWaiting}'

------
ancarda
If you use Haskell, then I'd recommend just using ghci over bc because you
can't do floating point stuff in bc:

    
    
        1/3
        0
    

Whereas ghci, or your language's REPL, will likely do better:

    
    
        > 1/3
        0.3333333333333333

~~~
RBerenguel
You can set up bc to any scale by adding

    
    
        scale=INTEGER
    

for some reasonable INTEGER, say, 6, to your ~/.bc file (you need to also
export BC_ENV_ARGS=~/.bc), or alias bc to bc -l). After having gp-pari fail
after a brew upgrade I started using bc instead and have been relatively happy
so far (although I miss isprime and factors which I used sparingly)

~~~
faho
Do note that setting scale breaks modulo tho.

------
xg15
Lots of people in this thread are recommending blogs, videos or books to get
to know the command line or just tell to RTFM.

I'd like to note that no manual at all is needed to understand a basic menu
structure or a GUI system with consistently used widgets.

------
whyhow
Does anyone know of a similar tool to the weather api wttr.in for stock
prices?

~~~
dredmorbius
There's surfraw(1)'s "\--stockquote" argument.

I've looked around for a freely-available source of raw stock quote data
without success (though not invested too much time in it). I've written my own
wrapper around Yahoo's stock quotes page
([https://finance.yahoo.com/](https://finance.yahoo.com/)) which strips off
everything but the prices themselves (see sample output:
[https://pastebin.com/gR2j3zB3](https://pastebin.com/gR2j3zB3))

However that's not something which will query for a specified portfolio.

It does feed xrootconsole nicely though.

------
lewisj489
This is really cool. Has anyone made a version for Windows?

~~~
incomplete
yep, it's called linux! :)

~~~
BuildTheRobots
Stallman would point out that it's gnu/linux... but then there's a number of
things he'd likely try and point out.

More seriously, this doesn't seem to be linux as much as it is bash and a
handful of commonly found on linux tools - all of which you can now run on
windows anyway.

Windows users: install bash and follow along.

~~~
yjftsjthsd-h
If one were feeling contrary, one could point out that it's _not_ GNU/Linux in
this context... it's GNU/NT (WSL1 and cygwin). Unless we're talking about
WSL2, in which case it is GNU/Linux again:)

~~~
BuildTheRobots
I saw Stallman talk about a decade ago and was thrilled to be picked on, so
asked a question about my Linux setup.

"I think you'll find," he interrupts me, like he's done to most of the other
people asking questions "that it's actually GNU/Linux" and then fixes me with
a look usually reserved for telling an adult that yes, they really have just
soiled themselves.

"Actually," I took great joy in responding, "I'm running Mr Torvalds' kernel
with a BSD userland, so really, I'm pretty sure I'll find it's not."

We haven't stayed in touch since.

~~~
yjftsjthsd-h
Beautiful. I've been wanting to do that, actually, but I keep having a rough
time because the BSDs tend to assume you're using their kernel, libraries, and
userspace all together.

------
bil7
awful scroll-jacking on this site. I really hate that.

~~~
cranekam
What is even the point of scroll-jacking like this? Is there some SEO or
monetization opportunity I don't get? Pretty much everyone (surely including
the site owner?) who runs into weird chunky wrestling-an-oiled-pig scrolling
like this is going to find it a crappy experience so there must be some
compelling reason that I don't understand for its continuing existence.

