ls --help not working on Mac #447

Open
cecileane opened this Issue Sep 13, 2016 · 7 comments

Projects

None yet

6 participants

@cecileane

On line 222 of _episodes/02-filedir.md, this command does not work on Max OSX, which implements BSD ls rather than GNU ls:

$ ls --help

I get this on a Mac:

$ ls --help
ls: illegal option -- -
usage: ls [-ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1] [file ...]

See this on that topic. I suggest replacing ls --help by man ls, which works for both BSD and GNU tools.

@morgantaschuk

The docs say that man ls doesn't work on Git Bash though, which is the recommended terminal client on Windows.

@cecileane

I see! so there is no one-fits-all solution. Have both ls --help and man ls plus a note, then?

@gdevenyi
Contributor

Sure, that sounds good. @cecileane can you make PR with this change?

@rgaiacs
Collaborator
rgaiacs commented Sep 14, 2016

Can we officially suggest that learners use their favourite search engine to look for "man command"? And have a additional box saying that they can try man command, command --help or command -h on their terminal but if it is going to work or not will be a matter of environment?

@iglpdc
Contributor
iglpdc commented Sep 15, 2016

I'd prefer to have man command as the "recommended" way of checking the documentation, leaving the box for Windows as is. The use case is, again, using a computer without a graphical interface such as a cluster, AWS machine, etc...

command -h or command --help usually show a subset of the documentation, mostly the usage part, but may be used for another options. Two examples relevant to the lesson are echo -h or echo --help, which just prints out -h or --help , and sort -h , which understand "human" numbers.

We could add another box "Other ways of getting help" mentioning that command -h or command --help are options that usually print a small subset of the documentation.

@morgantaschuk

I agree that man is the recommended way of checking documentation, but for Windows users who are (usually) newer to the shell than people using other operating systems, this tosses them out of the lesson into "it doesn't work" land.

I found an answer on Superuser that says that you can install man on Git Bash using MinGW-get install msys-man. I can't test that until I get home tonight, but perhaps it can be added to the pre-workshop setup instructions and all will be well.

@jrleeman

This does show up in other places as well, for example the finding things has grep --help, which won't work on Macs. Should a Windows/Mac/Linux recommended way be shown in all cases?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment