jarv / cmdchallenge

This repo is mirror of https://gitlab.com/jarv/cmdchallenge
https://about.cmdchallenge.com
MIT License
721 stars 71 forks source link

list_files challenge is wrong #101

Open natesilva opened 7 years ago

natesilva commented 7 years ago

Summary

In the list_files challenge, the instructions say:

# List all of the files in the current # directory, one file per line.

The expected response is ls.

This is wrong: ls does not list files one file per line. It lists multiple files per line. To list one file per line you would need the -l flag (ls -l).

Typical ls output looks like this:

root@io:/etc# ls
acpi                    fonts            ld.so.conf.d            pam.d                    shadow-
adduser.conf            fstab            legal                   passwd                   shells
aliases                 fuse.conf        libaudit.conf           passwd-                  skel
… (and so on)

Clearly that does not meet the challenge requirements.

Either change the challenge description to omit “one file per line” or change the answer to require ls -l.

Steps to reproduce

https://cmdchallenge.com/?ref=producthunt#/list_files

  1. type ls -l (the correct answer)
    • Answer not accepted.
  2. type ls (an incorrect answer)
    • Answer accepted.
0ki commented 7 years ago

-l is also not the correct answer, so this is partially valid.

Fake4d commented 7 years ago

I have issues too.. there is just one file in the directory or it is not working. The output says there are 24 files inside the directory?

ls -la is not accepted .. Is this correct ?

Here is my output:

bash(0)> ls -la total 24 drwxr-xr-x. 2 1000 1000 4096 Feb 6 15:21 . drwxr-xr-x. 32 1000 1000 4096 Feb 6 15:21 .. -rw-r--r--. 1 1000 1000 107 Feb 6 17:45 README

0ki commented 7 years ago

24 is not the number of files. See http://stackoverflow.com/questions/7401704/what-is-that-total-in-the-very-first-line-after-ls-l

Fake4d commented 7 years ago

Wah.. Sorry, my fault!

esuomi commented 7 years ago

Also acceptable and simple enough that they warrant being answers for such a beginner question:

boky01 commented 7 years ago

+1 ls is not correct if you have more than 1 file but the site accepts.