this post was submitted on
15 points (77% like it)
21 up votes 6 down votes
all 43 comments

[–]winzo 8 points9 points ago

sorry, this has been archived and can no longer be voted on

ack is big one.

Edit: Also see ack.vim, for Ack integration to Vim's quickfix.

Also various bash scripts and aliases, many of which are specific to my workflow, even a specific project.

[–]ruggednraw 4 points5 points ago

sorry, this has been archived and can no longer be voted on

Yeah, ack is great; #1 tool when having to dig through a big codebase.

[–]gmarik -1 points0 points ago

sorry, this has been archived and can no longer be voted on

[–]winzo 1 point2 points ago*

sorry, this has been archived and can no longer be voted on

No problem with preferring one tool over another, but that blog is completely missing the point of ack.

Using Ack was frustrating experience recently. Ack had troubles finding things.

True, it doesn't find things in files it doesn't even look in. HAML is not recognized by default.

Edit: HAML is not a default filetype, not 'unsupported'.

[–]folke 3 points4 points ago

sorry, this has been archived and can no longer be voted on

--type-set=haml=.haml

[–]winzo 0 points1 point ago

sorry, this has been archived and can no longer be voted on

Right, I should've said it's not a default filetype, not 'unsupported'.

[–]mekura3ohfizzle -2 points-1 points ago

sorry, this has been archived and can no longer be voted on

I have to give points to git grep for not needing silly configuration for basic tasks.

[–]winzo 2 points3 points ago*

sorry, this has been archived and can no longer be voted on

This is exactly what I mean by missing the point. It's meant to search certain filetypes quickly, not every file in a directory.

If you intend to search all files use grep. Or git grep if the file is in git.

[–]gmarik -2 points-1 points ago

sorry, this has been archived and can no longer be voted on

Exactly!

[–]sandsmark 0 points1 point ago

sorry, this has been archived and can no longer be voted on

wtf, that blog doesn't make any sense.

Firstly, ack doesn't need -R, and secondly he didn't even try to track down why ack didn't work. I've never had ack fail for me, and that behaviour he got just looked really weird. he could've spent five minutes debugging it, imho. oh well, os x people.

[–]winzo 1 point2 points ago

sorry, this has been archived and can no longer be voted on

Yes to all of this.

And the reason ack found nothing is because HAML isn't a recognized filetype by ack.

[–]folke 3 points4 points ago

sorry, this has been archived and can no longer be voted on

Which you can fix in your .ackrc

--type-set=haml=.haml

[–]gmarik -2 points-1 points ago*

sorry, this has been archived and can no longer be voted on

lol, non os x person

[–]gmarik -3 points-2 points ago

sorry, this has been archived and can no longer be voted on

yeah, cuz grep and git-grep "just works". I don't want to micromanage this kind of stuff

[–]toupeira 8 points9 points ago*

sorry, this has been archived and can no longer be voted on

Well I mostly use the obvious ones (grep, ack, find, git, rake, ...), but I think that it's more important to know how to use them properly, especially the shell itself. For example there's a lot of power in aliases, shell functions, and auto-completions. And of course the real magic of the shell reveals itself when you can quickly pipe a few commands together to get a certain kind of output, which would take a lot more effort to write in a proper programming language.

Other than that, here are a few lesser-known tools that I like:

  • rlwrap is an awesome tool that adds readline functionality (history etc.) to any prompt-based app
  • pv adds a progress-bar to an arbitrary pipe
  • tig is a text-based Git repository viewer

I also keep all my dotfiles on GitHub, if you're curious.

[–]minikomi 0 points1 point ago

sorry, this has been archived and can no longer be voted on

Very cool thankyou!

[–]roger1981 0 points1 point ago

sorry, this has been archived and can no longer be voted on

tig rocks. You pv link gives a 404, but installed immediately using 'brew'. Thanks. An alternative link for pv is http://pipeviewer.googlecode.com

[–]toupeira 0 points1 point ago

sorry, this has been archived and can no longer be voted on

Thanks, I replaced the link even though both do work fine here...

[–]mm256 4 points5 points ago

sorry, this has been archived and can no longer be voted on

[–]jerriman 2 points3 points ago

sorry, this has been archived and can no longer be voted on

Nobody mentioned tmux yet? Great companion for every console user.

[–]steelypip 3 points4 points ago*

sorry, this has been archived and can no longer be voted on

zsh - especially its file matching abilities. For example:

 grep wibble **/*.(js|html) 

will search for "wibble" in .js and .html files in the entire directory tree from the current directory down. This is why I have not felt the need to switch to ack and almost never use find.

sed and awk.

ipython - not only for developing python code, but also for doing data processing tasks that are too complex to easily do in sed or awk.

I use head a lot when developing a complex pipeline as a quick check to see that it is doing what I expect without it running off and processing gigabytes of data.

seq to loop a fixed number of times in a shell script:

for x in `seq 10`; do
    echo $x
done

The combination of sort | uniq -c | sort -n is useful to get a count of how many of each unique string is in the input. For example to get the ten most frequent words in a file, along with their counts:

cat somefile.txt | tr -s '[:space:]' '\n' | sort | uniq -c | sort -nr | head -n 10

[–]roger1981 1 point2 points ago

sorry, this has been archived and can no longer be voted on

true, about the grep part but for most uses if I can do just:

ack wibble

then why go for the longer form.

[–]winzo 0 points1 point ago

sorry, this has been archived and can no longer be voted on

I get what you're saying and I mostly agree, but to be fair, the real ack equivalent is like ack --html --js wibble

[–]super__mario 4 points5 points ago

sorry, this has been archived and can no longer be voted on

find, grep, xargs, sort, ls, awk, fmt, diff, cp, mv, rm, ctags, cscope, tr, xxd, dd, wget, more/less, cat, echo, printf, tail, head, sed, zip/unzip, tar, ps, netstat, lsof, for, while, set, export, cd, which, type, lynx, alias, man, help are among my most used commands.

Don't forget that BASH is a programming language as well, and it has a lot of built in commands (some listed above).

[–]dilithium 6 points7 points ago

sorry, this has been archived and can no longer be voted on

zsh ftw

[–]zemo 3 points4 points ago

sorry, this has been archived and can no longer be voted on

[–]zsoltika 2 points3 points ago

sorry, this has been archived and can no longer be voted on

awk, sed.

[–]ruggednraw 3 points4 points ago

sorry, this has been archived and can no longer be voted on

zsh, powered by oh-my-zsh and autojump spare me thoundsands of keystrokes a day, also making the usual boring tasks quite a pleasure.

It's the little things:

$ j src # directory I clone all the github trials
$ vim `ls **/*part_of_the_filename*.ext`

Not to mention zsh tab-completion awesomeness.

Wheter it's bash/zsh, I couldn't enjoy things without Ctrl-R (interacive history search).

[–]roger1981 2 points3 points ago

sorry, this has been archived and can no longer be voted on

z (the new j) for autojumping.

There's a history-substring-search for zsh that rocks.

mdfind (built-in, for finding files on OSX), glocate is the GNU version for that but requires indexing which really taxes the system.

most - instead of less for paging. (Install source-highlight to get syntax highlighting with less).

A lot of GNU coreutils.

[–]ruggednraw 0 points1 point ago*

sorry, this has been archived and can no longer be voted on

So what's the difference between z and autojump?

Edit: also, what's the diefference bewteen history-substring-search and Ctrl+R search?

[–]roger1981 0 points1 point ago

sorry, this has been archived and can no longer be voted on

Using history-substring-search, you press some characters, say "py" and press UP_ARROW. Immediately, it takes you back to commands which contained "py".

Not sure of autojump, seems z and j are similar, except that z (z.sh) has been tweaked for the z shell.

[–]fjonk 2 points3 points ago*

sorry, this has been archived and can no longer be voted on

vim ls **/*part_of_the_filename*.ext

No need to use ls, just do

vim **/*part_of_the_filename*.ext

[–]brennen 0 points1 point ago

sorry, this has been archived and can no longer be voted on

zsh, powered by oh-my-zsh

Well, that looks kind of awesome.

[–]karmalien 1 point2 points ago

sorry, this has been archived and can no longer be voted on

The Magnificent Ten:

cd, ls, cat, grep, cp, mv, rm, mkdir, rmdir, man.

[–]brennen 1 point2 points ago

sorry, this has been archived and can no longer be voted on

ispell for spelling. cal because sometimes you want a calendar. dict for word definitions. foo | w3m -T text/html for paging through HTML output. ack for finding stuff. wc to count stuff (lines, words, characters). ctags for jumping to definitions inside vim. cut and to a lesser extent join for munging columnar data. tail and head for watching or sampling log files. perl (and vim's :perldo) for one-liners, filters, utility scripts, etc. file somefile for guessing at a file's type. prove to run test files.

I use gitk and git gui all the time because (though not pretty) they save me a lot of keystrokes.

[–]m1ss1ontomars2k4 0 points1 point ago

sorry, this has been archived and can no longer be voted on

Obviously, ex and ed...just kidding.

[–]roger1981 0 points1 point ago

sorry, this has been archived and can no longer be voted on

I've actually used ex to in-place edit data files (in my shell scripts) since sed often crashes due to data containing the delimiter being used.

[–]voltagex 0 points1 point ago

sorry, this has been archived and can no longer be voted on

lesspipe.sh - no link because I can't find an "upstream" repo. ಠ_ಠ

[–]puffybaba 0 points1 point ago

sorry, this has been archived and can no longer be voted on

ls, cat, grep, awk, sed, bash

[–]edthedev 0 points1 point ago

sorry, this has been archived and can no longer be voted on

vi

[–]dalaio 0 points1 point ago

sorry, this has been archived and can no longer be voted on

emacs :p

[–]eazy_osm 0 points1 point ago

sorry, this has been archived and can no longer be voted on

grep, rsync, irssi, find, curl, tar, tail

[–]voltagex -2 points-1 points ago

sorry, this has been archived and can no longer be voted on

Nano!