> The popular grep replacements, for example, have rather unabashedly used ag and rg.
They've even made their brevity a selling point:
> [Compared to grep, ack's] command name is 25% fewer characters to type! Save days of free-time!
> What's so great about ag?... The command name is 33% shorter than ack, and all keys are on the home row!
Who would like to create ASCII art of Cathy saying that?
I have a program called ack that already has an ASCII art Bill The Cat, but I also need one of Cathy.
aptitude show ack-grep
Package: ack-grep
State: not installed
Version: 2.04-2
Priority: optional
Section: universe/perl
Maintainer: Ubuntu Developers <>
Architecture: all
Uncompressed Size: 216 k
Depends: libfile-next-perl (>= 1.10), perl
Description: grep-like program specifically for large source trees
Ack is designed as a replacement for 99% of the uses of grep. ack is
intelligent about the files it searches. It knows about certain file types,
based on both the extension on the file and, in some cases, the contents of the
file.
Ack ignores backup files and files under CVS and .svn directories. It also highlights matches to help you see where the match was. Ack uses perl regular expressions. Homepage: http://betterthangrep.com/
I had the same problem when I first heard about it. It shows as not installed because I use the latest version from the developers' site: http://beyondgrep.com/
If you install via apt, I recommend doing alias ack='ack-grep'
or so.
Pro-tip: Use ack instead of grep.
Note: On Debian based distributions, it is named ack-grep!
It appears people hadn't heard of of ack, the grep replacement for searching codebases.
It automatically ignores VCS metadata, can search only files in given language etc.. Nothing that you couldn't do without some 'find @#$% | xargs grep --ignore !@#&' magic, but it works out of the box, and it handles more languages and VCSes than any handwritten alias you might have in your .bashrc. See here.
Now somebody please upvote jyper back.
I like ack for this purpose, see http://betterthangrep.com/. There are several emacs modes to support it, google around.
There is also M-x grep or, better, M-x rgrep, which give you a compile-mode buffer that let you step through results.
I'm giving a talk at YAPC::NA specifically for people like you: http://act.yapcna.org/2012/talk/31 I'll watch this thread for ideas.
I would love to get something non-ugly for the front of http://betterthangrep.com, if you're interested.
I'll give you details on what I'm looking for. My email is .
Thanks for your interest!
I do the note taking thing. If I find myself looking something up I'm sure I've looked up before I add a new note.
Also I keep my language specific code together so that I can use ack to search my existing code for things I've done before.
I would love love LOVE to get a logo for a new project I'm starting on. It's especially appropriate because it's a website for helping get non-programmers involved with open source.
I just got someone to overhaul the design for http://betterthangrep.com, and I couldn't be happier. Thanks for offering!
Drop me an email, please? I'm at .
Thanks!
ACK is capitalized and there has to be a reason. I'm thinking it might have something to do with this http://betterthangrep.com/ or the TCP message? Google is nerdy after all. Or maybe since half of these puzzles are locations, it could be referring to Nantucket Memorial Airport, maybe? I still can't figure out how any of this ties in with the answer phrase though.
> it's easier to download ack, etc.
It's trivial to download ack. Here's the single command line from the front of http://betterthangrep.com/
curl http://betterthangrep.com/ack-standalone > ~/bin/ack && chmod 0755 !#:3
> if you never learn how to script such small logic,
Nobody is suggesting such a thing.
> most of the target audience could easily automate the task through their own means
Sure, they could, but why? Just to be Internet Tough Guy and/or Cranky Old Greybeard? Me, I've got work to do and not enough time to do it.
> both qgrep and grep aren't designed for the exclusive purpose of searching a directory were the user is certain there are only text files
Agreed, something like ack is more suitable for that.
> it'd be useful to give an example that works from / without choking on /dev...
--devices=skip
and --exclude-dir=/dev
both do the trick with GNU grep (which is available on all UNIXes...)
So in point 1 the author explains comparing your project to another piece of software is bad.
> Don’t describe your project in relation to another project, such as “NumberDoodle is like BongoCalc, but better!” That’s no help to someone who’s never heard of BongoCalc.
Not even two sentences further, he links to his own project, hosted on betterthangrep.com.
Holy fuck this article reeks of hypocrisy.
> unix grep and associated tool bag (sort, wc, uniq, pipe, sed, awk, …) is not flexible.
What?
> When your need is slightly more complex, unix shell tool bag can't handle it. For example, suppose you need to find a string in HTML file only if the string happens inside another tag.
Sure, more complicated problems require more complicated tools that offer better abstractions or other advantages. But for many small, simple tasks, programs like sed
and awk
are perfect. The command is often more succinct than its counterpart in python
or other language.
The article's certainly interesting, but I'm not sure his solution is the best way of going about it. One though was ack, though perhaps Windows unicode limitations (under cygwin
) would still be an issue.
Also, using regex with such a long string of HTML soup feels like he's doing it wrong.