Live data from Hacker News

Command line tools for productive programmers

earthly.dev

1–10 of 143 posts

Re: Command line tools for productive programmers

#4

I think productive programmers would get way further by learning powerful scripting and one liners than picking different pre existing binaries. Its a little oldschool but pipe is the most powerful concept on the command line and it’s wildly productive

Pipe is not old-school. Yea, 20+ years ago I learned that feature - and its much older. But! Daily since then I pipe to grep, sed, awk, cut and occasionally perl, php, ruby or now we have JavaScript CLI tools, wow!

Pipe is the new-cool! (always_was.jpg)

Re: Command line tools for productive programmers

#5

I think productive programmers would get way further by learning powerful scripting and one liners than picking different pre existing binaries. Its a little oldschool but pipe is the most powerful concept on the command line and it’s wildly productive

Though I agree that new is not necessarily better, and programmers should absolutely try to stratch their own itch with the existing tools (bash, sed, awk and the likes), some new tools are a great improvement and should be granted as such when due.

FZF, for instance, is a major novelty in terms of interface, and it really follows the UNIX philosophy and shows immense composability.

Re: Command line tools for productive programmers

#6

I think productive programmers would get way further by learning powerful scripting and one liners than picking different pre existing binaries. Its a little oldschool but pipe is the most powerful concept on the command line and it’s wildly productive

I think fzf is still a useful recommendation (better fuzzy matching for Ctrl-R). Or just Ctrl-R for reverse search in bash/zsh is a good thing to know.

Re: Command line tools for productive programmers

#8
For his usecase of funky i use ~/.bash_aliases, that way i can easily share them between machines. Eg to quickly add a new one: alias als="nvim $HOME/.bash_aliases && source $HOME/.bash_aliases"

Be careful with quoting though, got myself into a situation where every new terminal asked for the root password. Shellcheck found the reason quickly.

(edit) Another benefit is that those aliases abstract over differences of invocation on different distros. Here are some examples:

# PACKAGE MANAGEMENT

alias pcl="sudo zypper cc && sudo zypper purge-kernels"

alias pin="sudo zypper install -y"

alias pla="zypper search"

alias pli="zypper packages --installed-only | rg "

alias plu="zypper list-updates && zypper list-patches"

alias pre="sudo zypper remove"

alias pup="far too long" # upgrade all packages and ask for confirmation

alias pups="far too long + shutdown" # upgrade all packages without confirmation && shut down

# QUICK EDITS

alias als="nvim ~/.alias && source ~/.alias"

alias brc="nvim ~/.bashrc && source ~/.bashrc"

alias egr="sudo nvim /etc/default/grub && sudo update-grub"

alias fst="sudo nvim /etc/fstab"

alias pro="nvim ~/.profile && source ~/.profile"

# QUICK MOVEMENTS

alias ..="cd .."

alias ...="cd ../.."

alias ....="cd ../../.."

alias sc="shellcheck"

# SYSTEMD

alias sden="sudo systemctl enable --now"

alias sdls="sudo systemctl --type=service"

alias sds="sudo systemctl start"

# VIM

alias nrc="cd ~/.config/nvim/ && nvim init.lua"

alias nv="nvim"

alias scratch="nvim scratch.txt"

Re: Command line tools for productive programmers

#9
> if the directory has many files or sub-directories, tree becomes much less helpful: you only see the last screen full of information as files scroll past you.

> broot solves this problem by being aware of the size of your terminal window and adapting its output to fit it.

What? You can just pipe `tree` into `less`. The solution isn't to download Yet Another Binary that does this specific thing and doesn't come installed on most platforms.

Re: Command line tools for productive programmers

#10
post #8

For his usecase of funky i use ~/.bash_aliases, that way i can easily share them between machines. Eg to quickly add a new one: alias als="nvim $HOME/.bash_aliases && source $HOME/.bash_aliases" Be careful with quoting though, got myself into a situation where every new terminal asked for the root password. Shellcheck found the reason quickly. (edit) Another benefit is that those aliases abstract over differences of…

I’m also a heavy user of aliases and can’t see how I’d use funky. Behavior dependent on a current directory is rarely a good idea, and when it is, you can just create an explicit shell ./script
Post reply on HN