Question: Write the command that reads the file that has the name (text.txt) and shows only one page each time you hit space and it allows you to explore the file back and forward.
Indeed, traditionally more doesn't go backward. It's the first line of prose in the less(1) manpage: "Less is a program similar to more (1), but which allows backward movement in the file as well as forward movement."
Yeah, a handful of these tripped me up as well. I got:
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.
Technically the chances of tilde not working are the same as cd behaving differently because they’re both shell builtins.
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.
Not sure if the site is meant to be strictly Linux/Unix or not, but on Windows, cd without any path just prints the current directory and doesn't do anything else. (Although "cd ~" produces the response "The system cannot find the path specified.")
Color support is nice, default colors seemed terrible (blue on grey wasn't readable). The keybinds didn't make sense. No vi keybinds is a no go. At least do not touch hjkl!
I really thank you for giving it a try and for your comments. I should say that the user's answer could be correct in many cases. I am working on a more advanced answer normalizing feature using some regex expressions which will NOT be a default option. From my point of view, it is better to memorize one pattern of the command that does the work instead of focusing on searching how to use the command.
Maybe add a button that says “challenge this ruling I’m pretty sure im right” so at least you’ll know which ones people were sure on vs ones they got wrong because they guessed.
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".
That might make sense if there is some canonical answer to your questions. But if you arbitrarily choose "right" answer you are annoying people who already have some experience. But then, I guess you target people with little to not experience, right?
When I started the project, I did not have a better idea than this short video to introduce the game. I agree that this is not the best way and it is misleading. I am going to change it in the future.
Anki is superb for this sort of stuff. It implements a spaced repetition algorithm to keep the added content in your memory while minimizing the number of times that you need to refresh it. While used mostly for studying natural languages, there's nothing wrong with using it for IT stuff (I do).
(Edit: Dropped a bit that was left after some previous culling.)
I got bit by that as well. I think testing common arguments is useful, but I wonder if it would make more sense to limit to a single argument. That would eliminate the need to handle permutations, and it would also keep the questions simpler.
I think to do this properly you need to implement the argument parsing the command is doing; e.g., use getopt(3C). After all, "ls -la -h --" is valid too.
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.
> 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.
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.
there is also ls -lh -a, ls -l -a -h and so on. I am going to solve this by adding an option in the future to activate the regex if the user doesn't want to memorize a single pattern. Thanks a lot for mentioning it. Regards
I also got a similar result with this:
Question: Write the command that reads the file that has the name (text.txt) and shows only one page each time you hit space and it allows you to explore the file back and forward.
It's practice for your interview skills. If you're on a job interview, and you say 'ls -lha' when the interviewer is expecting 'ls -lah', chances are good you will be marked wrong, and may be passed over in favor of a candidate with "stronger command line skills".
But neither of those options is more or less correct than the other; there is no way to know which a strict (but apparently unqualified!) interviewer is going to prefer.
The responsive design is unusable on an iPhone SE. This would have the most appeal to me as something to use during downtime (e.g. on the train) rather than when I am at my desk so it’s too bad.
Another suggestion: Instead of just the verbal description of what to type, how about some sample output to? That wouldn't give away any answers but would help understand what you are looking for. Like when you asked "type text to the terminal" I put 'cat' instead of 'echo'. Sample output would probably have helped me there.
Thanks a lot for your suggestion. I agree 100% with you. I am thinking to provide hints to the users either by giving a link to the source or showing a picture of the results or both.
This is a really cool idea! I love that there's an option to train on git commands. Git has always been the kind of thing where I only learn as much as I need in order to do the task immediately in front of me, so this kind of thing might be a useful way to level up my skills in that area.
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.
UX feedback. Get rid of "Repeat Password" field. It will make the form look more user-friendly, as well as hide the scroll bar (at least on my MacBook Pro), so the entire page fit the screen.
And in practice: `cd my<tab>`. I strive to make the first three letters of a filename a unique prefix in each directory; and if I were to use a space like this, I’d be making sure “my” was a unique prefix. This system becomes a sufficiently ingrained habit that I can’t cope with Zola having a directory “content” beside a file “config.toml”.
I'm liking it so far. Doesn't bother me about being marked wrong when right. It's not like it's for anyone else. Getting some good lessons and refreshes, and works great on Firefox on my phone. Thank you very much for making it.
Anybody have a good Linux command line reference they might recommend? I've been using Ubuntu on my computer and it would be nice to have a resource for when I get stuck.
I have a curated list of resources[1] on topics like learning command line basics, bash scripting, style guide, etc. I have also have my own basics guide[2] and a comprehensive cli text processing repo[3]
90 comments
[ 3.0 ms ] story [ 168 ms ] threadYour 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.
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".
It would be great if watching the main image/animation on your front page showed what it's like to actually play the game!
(Edit: Dropped a bit that was left after some previous culling.)
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
Also:
Questions repeated multiple time within single session.
"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?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
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.
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
[1] https://www.shortcutfoo.com/app/dojos/command-line
[2] https://www.memrise.com/course/50252/shell-fu/
I think it didn't like my answers if I hit the 'enter' button.
[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...