alt.hn

12/8/2025 at 10:13:07 AM

Twelve Days of Shell

https://12days.cmdchallenge.com

by zoidb

12/8/2025 at 10:47:07 AM

The good: Nice exercises for beginners. Tab-completion, accepts readline characters like ctrl-u.

The bad: You don't see the (wrong) output if you don't get it right the first time, making it hard to work iteratively and having to guess what the question actually intended.

E.g. 'Seven files that start with "Santa"' actually wants file names that start with Santa, after some questions that had you use "grep" to search file contents. Where I actually struggled with what's expected is Day 11.

The ugly: Actually a very nice design.

by aargh_aargh

12/8/2025 at 3:56:19 PM

> Where I actually struggled with what's expected is Day 11.

Just the lines from the files are wanted, not the files names. It took me a little while to cotton on to that.

Semi-spoiler follows.

So you need to use the appropriate flag with grep to suppress the file names.

by pekim

12/8/2025 at 2:36:42 PM

The tab completion sorta works but it seems to be simulated, doesn't understand subdirectories etc.

by Retr0id

12/8/2025 at 11:41:27 AM

I think the instructions need more detail. 'Five lines that start with "the"' doesn't scream 'or "The", or "thE"' to me...

by oneeyedpigeon

12/9/2025 at 7:17:01 AM

Yeah, I was very confused why it wasn't accepting my grep at first.

by hdjrudni

12/8/2025 at 1:06:50 PM

Great idea, but a few feedback points:

1. It's difficult to know that it is following from the previous problem, and then on some problems it changes the workspace.

2. It's not always easy to know what it wants.

3. The question about finding a line starting with "The" I successfully cheated:

     cat night-before-christmas.txt | grep "The "
4. Likewise the ending "!":

    cat night-before-christmas.txt | grep "!"
5. On the eighth day I get a "runner error" with the command:

     mv *lve* Workshop
I'm globbing for the filename match, I'm not sure if it's "elve" or "Elve" and then trying to move to the target directory.

Otherwise it's quite fun - the instant feedback is great.

by bArray

12/8/2025 at 4:20:23 PM

iirc Elves is a directory with them inside.

by iN7h33nD

12/8/2025 at 10:37:22 AM

I've recently reached a point where I feel I've reached an upper limit with how much efficiency I can extract from my usual toolset/editors. So I've gone on a journey where I'm finally exploring tools that make living in the command line a productive and pleasant experience for me.

I've long put off learning or even exploring tmux or learning more than a few handful of vim keybinds. So I started digging into configuring them and learning them well enough to be able to regularly use them for work and personal computers.

It's been very pleasant, to say the least. There's still a few ways I need to go where I do everything from the command line and the keyboard, but I think it's worth training your muscles to be comfortable with doing things purely using the keyboard.

I've switched to vim mode for a few tools that offer it. I started seriously using vimium on chrome and firefox (a friend had introduced me to it about 7 years ago but I never cared enough to learn it well).

Another reason I finally made the jump was that I've been having RSI pain on my right hand due to using mouse too much and in un-ergonomic positions. While I've taken measures to improve ergonomic use of the mouse and keyboard, I'm just totally impressed with the capabilities of keyboard navigation and how much value you can extract out of your keyboard.

My friends have been egging on me about the bell curve meme, but I think it's important for me to figure out the limits and then maybe I will finally go back to defaults and simpler tools. The only way to be on the right side of the bell curve is through the middle.

by arionmiles

12/8/2025 at 10:46:27 AM

For learning vim, I recommend searching for a "vim cheat sheet" that has an image of a keyboard layout with vim commands in it and printing that. Makes it easier to check and learn more, little by little.

Another one is online tutorials that make you practice interactively. Haven't used those much but the little I did, it was helpful.

by kalaksi

12/8/2025 at 1:02:09 PM

Forget cheatsheets, tweets, videos, books, etc. Vim comes with a very well made built-in tutorial that will gently pull you toward maximum efficiency.

by johncoltrane

12/8/2025 at 1:17:02 PM

I love vim tutor!

I learnt the basics of vim navigation through it. I'm yet to finish it since I dropped it after the first chapter to start using it as a daily driver and picking things as I need. I will probably come back and go through it again at some point and by then it will be another mind-blown situation

by arionmiles

12/9/2025 at 8:57:24 AM

Hmm. It looks like I forgot a pointer to the actual tutorial. I wasn't talking about vimtutor, which only covers very basic topics, but about the much more extensive user manual: :help user-manual.

by johncoltrane

12/14/2025 at 10:13:40 PM

I use neovim. I thought you were referring to the :Tutor command which starts the interactive tutorial.

by arionmiles

12/8/2025 at 3:41:31 PM

been using vim for years, just did the tutorial and learned several things I did not know

by sambaumann

12/8/2025 at 7:15:07 PM

I have an odd suggestion for learning more of vim: Check out gvim.

It's vim with a GUI, dropdowns for nice discoverability and most importantly the shortcuts on each menu item are the commands to use it in regular vim. It's how I found out vim even had folding waaay back.

For Firefox, I use Tridactyl. After Vimperator died I tried several replacements and found Vimium very limited (IIRC it was the one that was just hotkeys and didn't have modes like vim, no idea how it's grown since then). I have Tridactyl configured to open gvim with the contents of any text input when I hit ctrl+i so I can use vim for them.

by Izkata

12/8/2025 at 10:45:47 PM

Shameless shill - I found Tridactyl and Vimium to be frustratingly limited due to the security restrictions imposed on web extensions, so I've been working on https://glide-browser.app/ for a while; It's a fork of Firefox with (some) vim motions and a TypeScript based config.

by probablyrobert

12/8/2025 at 9:32:44 PM

Vimium does have visual/caret/insert/command modes these days. Tridactyl does seem nice, I will check this out, thanks!

by arionmiles

12/8/2025 at 6:13:23 PM

Not commenting on the larger gist of the comment, only:

> I've been having RSI pain on my right hand due to using mouse too much and in un-ergonomic positions

If you can, try using a left-hand vertical mouse. I use an Evoluent but there are a million brands. Get a cheapo and try it out. I figure it took me about a week to adjust and my wrists have been happier ever since.

by ratrocket

12/8/2025 at 10:44:12 AM

I went back and forth over the years with vim. Lazyvim plus the ebook (lazyvim for ambitious devs or something like that, it’s free online) is what allowed me to stick.

I can’t be doing real work and suddenly realize I don’t know the way to do a certain basic action. Lazyvim makes it so that for everything you want to do, there’s an already configured way, and then you have all the time in the world to fiddle for a better alternative if you don’t like it.

by kace91

12/9/2025 at 5:27:16 AM

GNU Screen + dvtm/mtm + Vim (with some minimal plugins; especially for buffer mgmt) on a large Monitor is what you need to live on the command line :-)

Just have some minimal configs for the above and learn more of the default key bindings/behaviour etc. That way you can easily take the above setup to any machine that you move to.

by rramadass

12/8/2025 at 11:00:25 AM

Hey this doesn’t work : first solution “ls -al” which I use all the time to list directories was rejected in the second question I used awk and was rejected it expected grep

I think a beginner could be doing it right but then be told they are wrong as you aren’t evaluating actual commands

Best would be to like actually run it* and then check solutions out with awk that it pattern matches

* aka give me a shell ok worth a try lol xD

Edit: also I was expecting something a bit more challenging (also that is correct) to like exercise the brain for those of us that use shell (this is hacker news) something that takes a few minutes and isn’t just commands used all the time

by derrida

12/8/2025 at 1:15:46 PM

"ls" shows only visible files whereas "ls -a" also displays those starting with a dot. Given the question doesn't that make your answer the correct one?

by comprev

12/8/2025 at 3:17:29 PM

`la -A` will also show hidden files but excludes the "." and ".."

I prefer that way in theory but a capital "A" is not as quick/easy to type.

by zenoprax

12/8/2025 at 3:15:26 PM

It accepts ls -a as and answer and ls -l but not ls -al

by derrida

12/8/2025 at 2:41:00 PM

It does seem to actually run the submitted commands, and awk is there.

by Retr0id

12/8/2025 at 3:28:23 PM

Second question

> awk '/^laugh/ { print $0 }' night-before-christmas.txt

by derrida

12/8/2025 at 3:35:11 PM

Get rid of the caret and it works; it wants lines with laugh, not lines that start with laugh,

by aidenn0

12/12/2025 at 5:07:14 AM

Ah cheers thanks, my stupid! (And what's worse - wasted some others attention and even thought what someone took time to create was at fault!) However thankful for kind directness there.

by derrida

12/8/2025 at 5:20:01 PM

it also doesn't accept the find command.

by prmoustache

12/8/2025 at 11:22:18 AM

'Seven files that start with Santa' is actually about filenames. That's pretty confusing especially since users are primed with file contents from the previous exercises already.

And from pipers piping description I had no idea what was wanted of me.

by janmatejka

12/8/2025 at 10:13:56 PM

I think that may be the point, the subtlety of "lines of pipers piping" got me for a second - as opposed to the 11 pipers piping files (which is what I thought it wanted).

by Kakist0crat

12/8/2025 at 12:18:05 PM

Looks nice but it's rejecting valid commands as incorrect. Like when it told me to search for "laugh" I ran

  grep laugh *
There's only one file in the directory. So that's a correct answer but the game wants me to run

  grep laugh night-before-christmas.txt 
It's like those weird interviewers who have a specific answer in mind and they'll accept nothing other than the answer they have in mind.

by blenderob

12/8/2025 at 1:13:09 PM

`grep laugh *` worked for me

by charlie-83

12/8/2025 at 1:28:36 PM

I tried again to see if they fixed it. No it still doesn't work. You'll get the output but look closer.

  Output does not match expected lines - try again
So you can't move on to the next level.

by blenderob

12/8/2025 at 1:41:36 PM

they must have fixed it. Works for me, including new sessions on separate browser.

by szszrk

12/8/2025 at 2:00:26 PM

Still doesn't work for me in a new session separate browser. I get the output but I also get this message

  Output does not match expected lines - try again
Does it give you the clue for the next level? Can you or someone else share a screenshot or something so I can compare to find out what I'm missing?

by blenderob

12/8/2025 at 2:05:29 PM

For clean session it goes to the next level.

There is some mess if you already finished the thing, and then use url to particular level on a clean session. For me it looked like I am on level 2, but site expected answers to 1.

When I start from scratch with proper link (main page) simple:

grep laugh *

works

by szszrk

12/8/2025 at 2:38:06 PM

Worked. Thanks!

by blenderob

12/8/2025 at 1:04:10 PM

Or cat night-before-christmas.txt | grep laugh

by ggirelli

12/8/2025 at 5:15:21 PM

I thought there was too much ambiguity to several of the challenges:

I gave up after the following exercise:

On the eighth day of Shell my true love gave to me Eight elves in Santa's Workhop/ ... Hint: Try finding files named after Elves and moving them to the Workshop/ directory.

It turns out, all they want is the files in the ./Elves directory to the ./Workshop directory. But I didn't figure that out.

by lcuff

12/8/2025 at 8:07:23 PM

You're overthinking it. You can get quite far with a bit of ls or find . -type f exploration

by imp0cat

12/11/2025 at 7:31:33 PM

Failing to understand the basic requirement is not, IMHO, overthinking it.

I will admit, as I reread the question and the hint just now, that I just didn't read carefully the first time through. It's actually pretty clear. Sigh.

People's minds work quite differently ... As evidenced by people that have strong reactions to particular languages (love or hate), or, as another example, people that love or hate syntax coloring in code. (Yes, it gets in the way for some). The fact that the instructions didn't make the problem clear to me is not an overthinking problem on my part. It would be better for me if the problems were expressed in different ways.

When trying to communicate, saying the same thing two different ways is a big step towards helping deal with the variance in people's minds. I wish they'd done that with some of the questions.

by lcuff

12/8/2025 at 1:11:53 PM

Meta: the first day of the Twelve Days of Christmas is Christmas Day (December 25) itself:

* https://en.wikipedia.org/wiki/Twelve_Days_of_Christmas

The days before the 25th are part of the season of Advent:

* https://en.wikipedia.org/wiki/Advent

by throw0101d

12/8/2025 at 1:17:41 PM

Too many people I know spend their boxing day packing up their tree. Christmas is over before it's barely begun!

But that's kind of understandable when Christmas begins in September if you believe the retailers.

by xnorswap

12/8/2025 at 4:37:39 PM

Indeed. Christmas lasts until Epiphany (January 6th) or even Candlemas (February 2nd).

Commercialism is likely the culprit for the current state of affairs. By putting the "Christmas season" and the commercialized variety of festivity before Christmas and making Christmas day the big finale, you create a situation during which you can get people to buy, buy, buy. And then it's over.

Compare that with the real deal and as it was traditionally celebrated. Advent is a period of contemplation, waiting, quiet, abstinence from meat -maybe even fasting - in anticipation for the birth of Christ. Then, on Christmas Eve and especially Christmas day, the festivities kick off, and they last until January 6th (the 12 days of Christmas) or Candlemas (40 days of Christmas). And that's when people used to pack up their trees and decorations (either Jan 6th or Feb 2nd).

People today suck at festivity. We're boring.

by lo_zamoyski

12/8/2025 at 6:00:56 PM

IMO, commercialism moreso moved into the empty husk left after the Calvinists got to holidays, especially the puritanical sects that took root in the US. Specifically, I blame double-predestination: if you tell a bunch of people with free will that everyone is sorted into two groups, one going to heaven, one going to hell, and that the people going to heaven behave a certain way, it creates a much more oppressive, all-encompassing culture than traditional Christian "apologize and go to heaven because Jesus loves you" teachings. If your concern is not being judged negatively in the afterlife, you basically just need to follow some rules, try to be a generally good person, and you're generally free to do whatever else that isn't covered in the above categories. If you're concerned about demonstrating to others in your community that you are one of the God's chosen, who behave a certain way, that necessarily becomes universal factor in your life, which keeps escalating with time. This preoccupation with not being perceived as "having to much fun" so-to-say killed festivals.

by OkayPhysicist

12/8/2025 at 11:17:35 AM

As a developer I've been through 10 different languages and about the same number of operating systems, and I barely managed to remember any of them, even at the time. And I assume soon using natural language as the main interface will become commonplace, which will finally let me off the hook.

I will give this a go, but I doubt any of it will stick!

by beardyw

12/8/2025 at 11:19:07 AM

Shell quotes is the last frontier LLM's seem to keep getting wrong. Esp when it's Github CI yaml which needs to ssh somewhere and run command running another command there. Needs AGI apparrently.

by k_bx

12/11/2025 at 5:44:51 AM

That and giving me GNU awk/grep/sed shit when I specifically asked for macOS/BSD.

by wpm

12/8/2025 at 10:51:20 AM

It looks very nice. One problem I've encountered is that when you make a mistake then the name of the file you have to use disappears and it's impossible to get it back. What is this website created with btw? I like the style a lot.

by bluecalm

12/8/2025 at 4:34:53 PM

Constantly hit Ctrl-w and close the tab. Ctrl-Shift-Tab to get back to it :-) God bless saved state, otherwise I would not have completed :D

by ilvez

12/8/2025 at 10:21:50 AM

Fun idea. It’s basically an Advent calendar for shell one-liners. Nice way to level up your CLI muscles without diving into full projects.

by Barathkanna

12/8/2025 at 11:15:26 AM

Neat.

Perhaps it would be even nicer if the "advent" theme was more prominently present, e.g. using the Bible as the target data file to be used.

Here's three examples tasks from me:

(1) Write an sh script (using only POSIX standard commands) to create a Keywords in Context (KWIC) concordance of the new testament.

(2) Write a bash script that uses grep with regular expressions to extracts all literal quotes of what Jesus said in the New Testament. [Incidentally, doing this task manually marked the beginnings of philology and later automating it marked the beginning of what was later called literary and linguistic computing, corpus linguistics, computational linguistics, and digital humanities.]

(3) How many times is Jesus mentioned by each of the four accounts of his life (Matthew, Mark, Luke, and John)?

(You may begin by extracting the New Testament from the end of the Bible with a grep command.)

Dataset: https://openbible.com/textfiles/kjv.txt

by jll29

12/8/2025 at 1:13:45 PM

Respectfully, many would find that off-putting. "Advent of X" in tech is entirely decoupled from religion. Keeping it neutral seems to me the "nicest" approach. That said, something like what you described might be a cool exercise for your bible study group. Finally, I appreciated your "incidentally" aside about the origins of philology.

by chrisweekly

12/8/2025 at 5:09:20 PM

I'll preface this by saying I was never especially bothered or moved by the non-religious use of "Advent of X", for better or for worse. In fact, my remark is inspired only by your comment, concerning its consistency and who has the stronger case.

Specifically, while it is true that certain kinds of words can become decoupled from their original meanings (which is generally normal), in this case, the usage is not so decoupled, especially given that this usage occurs during the religious season of Advent and with the intentional allusion to the religious season of Advent. (Otherwise, what is "Advent of X" without its religious origin and which takes place at the exact same time during the year?)

You can make a much stronger argument that the non-religious usage is a kind of cultural appropriation. That would make your concern entirely backwards. Your wish is to keep it "neutral" to please those who don't practice Advent, as you show a simultaneous lack of concern for the tradition it appropriates from. This involves a tacit claim of possessing the authority to do so as well, but if anything, given the source, if anything, the authority belongs not to the appropriators, but to the Church.

One wonders how a "Ramadan of Code" or "Teshuvah of Shell" would be received.

"Neutrality" is, of course, a bunk concept, and the idea that we ought to be guided by what is "nice" rather than what is "good" is a grave misunderstanding of how decisions ought to be made.

by lo_zamoyski

12/9/2025 at 3:44:02 PM

Thanks for the response. I don't intend to get into a protracted debate here, but would like to point out that the winter solstice holiday we call "Christmas" was itself appropriated from various traditions, esp. "Saturnalia" as practiced by the Romans. In modern times, countless non-religious homes in the US feature "advent calendars", with tiny treats hidden behind numbered doors. They -- like santa, elves, gift-giving, and "christmas" trees -- have nothing to do with Christian orthodoxy.

By all means, you should do what you think is "good". That's what I strive to do. My comment about "nice" was literally quoting you, so in trying to take me to task for that, as with your broader point, you've missed the mark. I don't think your hypocrisy is intentional, but I do feel good about pointing it out.

Have a nice day and holiday season! :)

by chrisweekly

12/10/2025 at 2:02:48 AM

#11 was confusing as hell: this is what worked 'grep -R 'piping' ./place-for-pipers | cut -d: -f2-'

only content no filenames. Need to see the output if it's wrong to baseline what's being asked.

by kwar13

12/8/2025 at 12:32:04 PM

The way that worked for me to properly learn shell is to do a non-shell project with it.

Like, do a complex background worker for a web server that listens to a socket, does complicated stuff, exports functions (if in Bash), etc.

You don't have to use it afterwards. The value is in the journey. It's fun :)

by haolez

12/8/2025 at 11:48:44 AM

Fluent in shell, but cultural context is more difficult, especially with pipers, had to do guess work.

by sannysanoff

12/8/2025 at 1:05:32 PM

I think that's part of the fun :)

by ggirelli

12/8/2025 at 2:14:29 PM

It doesn't handle backspace correctly. The character is erased visually, but not removed from the buffer, so when you type the next character, the erased character reappears. Make one typo and you have to reload the page.

by cornonthecobra

12/8/2025 at 3:10:12 PM

"Try sending the command ls in the command box to list all files in the directory."

  My answer: `ls -a`
er, wrong. Then don't put all in the question!

by 6LLvveMx2koXfwn

12/8/2025 at 6:42:50 PM

I use the shell all day every day and I got stopped at the SECOND question.

"lines that contain 'laugh'". lines of what? Doesn't tell you without looking at the answer.

genius.

by naikrovek

12/8/2025 at 12:35:13 PM

How would one make a true shell in a website like this one? (As in, is there an open source library to host an interactive shell for educational purposes - eg codecademy)

by FailMore

12/8/2025 at 2:29:38 PM

I couldn't tell you the exact details (I'm only passingly familiar with how it works myself), but you'd almost certainly want to start by looking into web assembly.

I found a-Shell's documentation[1] quite interesting, it describes their use of web assembly and offers some practical tips for compiling stuff so it can work in a sandboxed environment.

[1]: https://bianshen00009.gitbook.io/a-guide-to-a-shell/lets-do-...

by ctippett

12/8/2025 at 11:07:04 AM

It would be nice if the instructions spelled out what to do, then I could do it. Otherwise I have to guess what author meant. But all in, a nice small exercise, thanks!

by benterix

12/8/2025 at 1:31:16 PM

I tried to grep for "♫ piping ♫" at some point and the website got stuck. I wonder what it was trying to do...

other than that - nice exercise for newbie shell dabblers :-)

by einpoklum

12/8/2025 at 10:45:46 AM

Neat idea à la regex golf.

But doesn’t seem to do enough shell escaping or correctly. Also seems underspecified, ie “find 5 lines starting with ‘the” doesn’t require a pipe to head -5.

by pstoll

12/8/2025 at 11:44:43 AM

> find 5 lines

Especially since the previous two questions used head/tail. IMO, the wording would be better as "find all the lines" since that's what the command does.

by oneeyedpigeon

12/8/2025 at 3:22:15 PM

I would love something like this that puts me in my own shell. Like a light CTF that is really just shell commands rather than breaking into a VM

by mejthemage

12/8/2025 at 3:24:38 PM

I went searching and realized overthewire has a bash specific course called "Bandit". Still a VM you SSH to

by mejthemage

12/11/2025 at 3:15:50 PM

Not giving real output is a complete fail. Try again.

by tensility

12/8/2025 at 10:27:24 PM

That's a nice little challenge.

I did have some issues with Day 11 figuring out what it wanted, but overall it was fun.

by chillfox

12/8/2025 at 4:22:50 PM

If you like things like this you'll probably enjoy

     b64(r13(MaE3o3OmYz5yqPNtqUu0VPOxnJpX))

by lozf

12/8/2025 at 10:54:04 AM

Tab complete is completely broken on Firefox mobile (Android)

by franticgecko3

12/8/2025 at 11:47:34 AM

Cool idea but very opinionated and no room for variation

by sva_

12/8/2025 at 11:29:34 AM

I assumed this was some kind of hacking challenge.

by ParadisoShlee

12/8/2025 at 2:09:37 PM

That font is not very easy to read quickly.

by smusamashah

12/8/2025 at 5:27:51 PM

I have serious issues reading that font

by entropie

12/8/2025 at 10:52:10 AM

Viewing the page with Safari 26.1 the questions stopped showing up after the second challenge. I was left with only Learn and View Solutions, which was not very fun since both showed a form of the answer.

TL;DR: The page stopped loading properly.

by skinwill

12/8/2025 at 11:50:04 AM

> Safari [..] The page stopped loading properly.

Who would've guessed...

by Milpotel

12/8/2025 at 1:44:06 PM

I mean if you ask for the lines that start with "the" and expect lines that start with "The", maybe you should say it in the instructions.

After the 3rd time I had to peek at "learn" to understand what was even asked, I gave up. This is more annoying than fun.

by Biganon

12/8/2025 at 12:16:49 PM

Terrible. You cannot 'ls' if ls is not the right answer. Completely useless.

by dncornholio

12/8/2025 at 8:09:00 PM

That's not true. You can absolutely use ls and other commands to poke around before creating the winning command.

by imp0cat