Code Self Study Forum

CLI: improved (command line tools)

Interesting command line tools: CLI: improved

Summary:

Related: this book was good:

See also: Interesting Command Line Tools

Here are some more: Without a GUI–How to Live Entirely in a Terminal

Programs mentioned:

Music Player Daemon is light weight and stable. MPD is the server and it requires a client. You can use the command line, console, web, or GUI as the client.

Clients:
ncmpcpp
vimpc

1 Like

Nice, I guess mplayer should be mentioned here too. I play directories of music like this:

$ mplayer lutes/*

I just tried fzf (mentioned in the top post) and it’s great. :exploding_head:

It completes with fuzzy search.

Examples:

$ vim <ctrl-t>
$ kill -9 <tab>

It also takes over ctrl-r.

There is a demo here:

I also just tried bat and it’s good.

Edit: I copied the fzf config that was in the video. I added the --exclude build --exclude dist part and changed pbcopy to xclip -selection clipboard, because I’m using Linux and not Mac.

FD_OPTIONS="--follow --exclude .git --exclude node_modules --exclude build --exclude dist"
export FZF_DEFAULT_OPTS="--no-mouse --height 50% -1 --reverse --multi --inline-info --preview='[[ \$(file --mime {}) =~ binary ]] && echo {} is a binary file || (bat --style=numbers --color=always {} || cat {}) 2> /dev/null | head -300' --preview-window='right:hidden:wrap' --bind='f3:execute(bat --style=numbers {} || less -f {}),f2:toggle-preview,ctrl-d:half-page-down,ctrl-u:half-page-up,ctrl-a:select-all+accept,ctrl-y:execute-silent(echo {+} | xclip -selection clipboard)'"
# Use git-ls-files inside git repo, otherwise fd
export FZF_DEFAULT_COMMAND="git ls-files --cached --others --exclude-standard | fd --type f --type 1 $FD_OPTIONS"
export FZF_CTRL_T_COMMAND="fd $FD_OPTIONS"
export FZF_ALT_C_COMMAND="fd --type d $FD_OPTIONS"
export BAT_PAGER="less -R"