Show HN: Memorize Terminal Commands
memorize-terminal-commands.com
memorize-terminal-commands.com
It would be great if watching the main image/animation on your front page showed what it's like to actually play the game!
Your answer:
ls -lha
Correct answer:
ls -lah
Oh dear.Also:
Questions repeated multiple time within single session.
Question: Write the command that clears the terminal
command line screen and shows it as new
Your answer:
reset
Correct answer:
clear
"Clear" will not fix terminal in some cases. Maybe do not ask for "and shows it as new" and note you only want to remove current text? Question: Write the command that you use
to move into your home directory '~'
Your answer:
cd
Correct answer:
cd ~Your answer: dev
Correct answer: /dev
Edit: Also
Question: Write the command that shows a text 'hello world' in the console without moving to a new line after executing the command
Your answer: printf '%s' 'hello world'
Correct answer: echo -n 'hello world'
Your answer: less test.txt
Correct answer: less text.txt
Also
Question: Write the command that you use if you finish working with the terminal and you want to log out from the current session.
Your answer:logout
Correct answer:exit
Clearly the correct way to implement this is to run each command in a short-lived container and check the output matches what's expected. For things like the pager questions, it'll need to implement a full vte and vte comparison, so that should be fun.
For bonus points, one of the options to emulate linux in the browser could be used to do that more securely and without the need for a service... though the load time might increase by several minutes or hours.
I'm not sure it is clearly correct. Some commands don't produce output, `mkdir` and `cd` for example (the first two in the animation). Furthermore they'd have to blacklist `echo` and other ways to produce the output against the spirit of the exercise... until an answer is, say, `echo $?` - at which point you'd require a preceding command exiting in a suitable way in order to keep the "just execute it" approach workable.
Just a few seconds on my humble E480 using Firefox: https://bellard.org/jslinux/vm.html?url=https://bellard.org/...
Question: Write the command that clears the terminal-command line screen and shows it as new Your answer:Clear Correct answer:clear
Your answer: more text.txt
Correct answer: less text.txt
Question: Write the command that you use to move into your home directory '~'
Your answer: cd
Correct answer: cd ~
The man pages specify that cd moves into the current user's $HOME directory if called without arguments, but I'm sure there's some mystic difference between cd $HOME and cd ~ in certain cases.
cd without an argument will change directory to $HOME if $HOME is set and the value is non-empty as defined in the standard linked above. That’s not to say that all Unix-like systems do or even try to implement everything of that standard, but it’s a good indicator pointing to that a lot or most of them probably do.
As for cd ~, tilde expansion is done by the shell, not by cd. Same goes with any other command that you type ~ as the leading part of a path and provide as argument. (Also, in bash, among others, cd is a builtin command.) The shell will substitute the ~ for the path of your home dir when ~ is alone or followed by a slash and anything else. (And you probably know also that ~example would refer to the home dir of a user named “example”.)
I think you will sooner run into a system with a shell that doesn’t do tilde expansion, than you will run into a Unix system where plain cd without an argument doesn’t bring you to your home dir.
I’m guessing (though admittedly not checked) that both ~ and cd (without parameters) are defined in POSIX. In which case any edge case that doesn’t conform could reasonably be discounted with regards to the submission’s exercise.
https://www.unix.com/man-page/posix/1posix/cd/
Also I don’t know why many of my posts keep getting downvoted even when they’re factually accurate.
Question: Write the command which you use to move inside the directory which has the name 'my dir' (the name contains a space)
Your answer: cd 'my dir'
Correct answer: cd my\ dir
I also really love that in the "about" section, you include lots of details about the architecture of the project. I was only expecting a summary of how to use the project, but all these additional details were really nice to see.
I assume this is supposed to be `man ls`.
>You move inside the help document of the ls command. Write the keyboard key that you can use to move forward to the next page inside the help document
> Your answer: page down
> Correct answer: f
I mean, both work? Maybe my answer is less likely to work ona remote system with TERM set wrong.
I found it difficult to read/parse the descriptions, they almost feel like sentence riddles. Also, the column width may be too wide for fast reading. Maybe one could solve these more quickly if there was always the same format using newlines like "type the command\nwhich will display x\n such that y".
(Edit: Dropped a bit that was left after some previous culling.)
Would be slightly better if the questions were more specific, or at least accept multiple answers.
I could see the fun in that. Also you wouldn't have the issue of people complaining about right and wrong answers because you would have to write just as it was printed.
I appreciate your effort and your time testing the website. It was a great help to me. Your feedback is the light in the darkness. There are a lot of ideas in the pipeline. Your feedback helps me to prioritize them. Big thanks for everyone who wrote feedback here or sent it to me via email or LinkedIn. Thanks for all 9k+ tester. This is my Sunday project. Each Sunday, I am going to release a new version with a new fix or feature.
Best regards
Maher Deeb
Write the command that asks git to add all changes that have been made inside the project that git tracks.
Your answer: git add -A
Correct answer: git add .[1] https://github.com/learnbyexample/scripting_course/blob/mast...
[2] https://github.com/learnbyexample/Linux_command_line
[3] https://github.com/learnbyexample/Command-line-text-processi...
I think it didn't like my answers if I hit the 'enter' button.
Your answer: ..
Correct answer: cd ..
Nope.