Command line and programming cheat sheets

I learnt about this awesome project this week, if you code or use the command line at all you may find it helpful. :slight_smile: is a project which aims to provide cheat sheets for command line tools and programming languages.

It can be used on the command line as long as you have a HTTP client like curl or wget installed. E.g.,

$ curl
# Show the absolute path of your current working directory:

# pwd
# Print name of current/working directory.

# Print the current directory:

# Print the current directory, and resolve all symlinks (i.e. show the "physical" path):
pwd -P

It can also be used from a browser by visiting, or there is a command line client and integrations for several editors.

It also has sheets for many programming languages. E.g.,

$ curl
 * c - Implementation of strcmp
 * Uhm.. way too complicate. Go for this one:

int strCmp(const char* s1, const char* s2)
    while(*s1 && (*s1 == *s2))
    return *(const unsigned char*)s1 - *(const unsigned char*)s2;

 * It returns <0, 0 or >0 as expected
 * You can't do it without pointers. In C, indexing an array is using
 * pointers.
 * Maybe you want to avoid using the * operator? :-)
 * [Gianluca Ghettini] [so/q/34873209] [cc by-sa 3.0]

or ask it questions, for example

$ curl
#  question_id: 20548628
#  You can use the [multiprocessing](
#  tiprocessing.html) module. For this case I might use a processing
#  pool:

 from multiprocessing import Pool
 pool = Pool()
 result1 = pool.apply_async(solve1, [A])    # evaluate "solve1(A)" asynchronously
 result2 = pool.apply_async(solve2, [B])    # evaluate "solve2(B)" asynchronously
 answer1 = result1.get(timeout=10)
 answer2 = result2.get(timeout=10)

#  This will spawn processes that can do generic work for you. Since we
#  did not pass `processes`, it will spawn one process for each CPU core
#  on your machine. Each CPU core can execute one process simultaneously.
#  If you want to map a list to a single function you would do this:

 args = [A, B]
 results =, args)

#  Don't use threads because the
#  [GIL]( locks any
#  operations on python objects.
#  [Matt Williamson] [so/q/20548628] [cc by-sa 3.0]

(it searches stack overflow for you!)

or even

$ curl | more

if you’re into that sort of thing :wink:

1 Like

Excellent find! I can’t quite grasp the meaning of the colon-headed keywords (I suppose it’s a marker of meta topics), but I see
is there for me.

Also, as entry points:

It’s good to see there are topics on awk and emacs… and other programming languages.

Oh, and stealth mode for online interviews - not so sure about that! (It monitors X’s selection buffer and responds silently in your terminal - no typing needed.)


The code snippets look slightly mind-blowing for getting up and running quickly (clearly not all of them will work out of the box, but still).

The editor integrations on the readme look great for quickly hacking something up (or when you switch languages a lot, start typing in the wrong language & need a nudge).

The VSCode extension (vscode-snippets) uses to get them directly into the editor via the command menu. It has a nice “find snippet based on selected text”, which looks like a good tool when you come across some esoteric code in a project.
(it’s just a creative way of presenting cht.sht but seems good)