2015.04.09

Simpler CLI tools

grep, find, sed, awk are powerful and fast, but their APIs are hard to memorize and sometimes very awkward; so that’s why I use some tools that are slower but are way more user friendly.

Haters gonna hate, and there is definitely a hidden cost on using theses tools (you won’t learn the standard ones); but there is also a huge benefit on the ease of use.

Here are the tools that I use often:

z
jump between frequently used folders with ease (must have!).
ffind
searches for files by name inside a directory based on pattern.
spot
search for files that contains a given string.
ag
similar to spot but with more features. (worse output on minified files tho)
replace
search-and-replace on files. It’s similar to sed but uses JS RegExp
syntax, modifies files in place & recursive search on directories with -r.
the preview -p flag is really helpful.
http-server
basic static server, simpler than starting apache or python SimpleHTTPServer
(and can handle more requests than SimpleHTTPServer).
tldr
simplified help for common command line tools (man pages are usually verbose and hard to understand).
greadme
preview Github README/markdown files locally.
sloc
counts SLOC (source lines of code) inside a folder.
wr
watch files and run a command when they change
disparity
colored file diff, better than diff(1) when comparing white-spaces,
indentation and line breaks (output is easier to understand).

Not saying these are the best ones for the job, just that they do help me to do what I need. I’m by no means an UNIX/shell expert.

I hope these tools also help you do your job faster.

Cheers.

Tags: , ,

Comments

Matías Lescano

Certainly did. Thank you!

After talking about greadme with friends this other tool came out with better options, including a watch option: https://www.npmjs.com/package/github-markdown-preview

Wesley de Souza

Just stumbled upon this gem, perfect for this list as well:

https://github.com/nvbn/thefuck

Leave a Comment

Please post only comments that will add value to the content of this page. Please read the about page to understand the objective of this blog and the way I think about it. Thanks.

Comments are parsed as Markdown and you can use basic HTML tags (a, blockquote, cite, code, del, em, strong) but some code may be striped if not escaped (specially PHP and HTML tags that aren't on the list). Line and paragraph breaks automatic. Code blocks should be indented with 4 spaces.