top | item 39101454

(no title)

Charlie_32 | 2 years ago

I'm a developer of 10 years, and use the command line for Git, Brew and a few other things, though I'm normally an IDE developer. I believe the CL is as powerful as everyone says, but what are some useful things I can use it for? I use Zsh on a Mac some of the time.

discuss

order

d0mine|2 years ago

"Always Bet on Text"

- CLI encourages automation (shell commands are easier to repeat/parametrize then GUI steps) - shell instructions are more git friendly than screenshots (even if a process can't/shouldn't be automated. Commands are easier to document in a reusable/updatable way) - CLI can be used to run tests in a way similar how CI does it (more reproducible)

Command line tools are easier to extend/combine with existing pipelines (rg,jq,xargs): read input from stdin/write output to stdout, report on stderr, return non-zero code on error. It enables you to create adhoc tools that you wouldn't bother otherwise (unrelated: LLMs also have this property by making your skill set much broader (though very shallow with current LLMs)). Shell also has Forth-like property (compose with: retry, timeout, setuid, exec, xargs, env, ssh, etc) https://www.oilshell.org/blog/2017/01/13.html

pletnes|2 years ago

Rename hundreds of files at a time. Find stupid errors in GB sized csv/json/.. data files. Automate git bisect. Automate workflows by writing a short loop or 3 commands in a row you can easily repeat. Down/upload big datasets. Convert text files any way you can think of.

jay-aye-see-key|2 years ago

The two things you can do in the shell you mostly can’t do elsewhere is compose arbitrary commands and store custom commands.

For #1 this blog post has some good examples of quickly chaining together commands (though personally I rarely use xargs) https://drewdevault.com/2020/12/12/Shell-literacy.html

For #2 once you’ve got a command you like, maybe one that generates a metric, you can now re-run it with ease from your history, saved text file, or an alias. You could also share it with teammates.

Please correct me if there are other ways to achieve the above, shell is the only way I know

pjmlp|2 years ago

Programming languages REPL environments.

reactordev|2 years ago

Colorful prompt with context information, powerline glyphs, autocomplete, command highlighting, easy navigation through strings, plugins and a plugin ecosystem that extends your shell like crazy

PrimeMcFly|2 years ago

> but what are some useful things I can use it for?

I mean, surely you already know?

Anything where feeding input between different tasks, or where you want to use regex, or similar things the cl will be superior.

smcleod|2 years ago

10 years in tech and you haven’t optimised your shell?

Brajeshwar|2 years ago

20+ years in tech and these days, the first thing that comes to my mind is usually, “Can I walk out of this?” :-)

The idea is to be able to use any computer/system/devices easily instead of one perfectly.

pjmlp|2 years ago

Coding since 1986 and I touch the shell as much as I have to, If I cared that much I would still be using MS-DOS, and UNIX without X.

cnity|2 years ago

X years in tech and you haven't Y.

Pick any X and Y that maximises your ability to feel superior, I suppose.