swcarpentry / DEPRECATED-bc

DEPRECATED: This repository is now frozen - please see individual lesson repositories.
Other
299 stars 383 forks source link

No `-s` flag for `ls` on Mac #685

Closed BernhardKonrad closed 9 years ago

BernhardKonrad commented 9 years ago

Apparently, the Mac terminal does not have a -s flag for ls. At least, it did not work for several students in a bootcamp last week. This comes up in the 4th challenge on Files and Directories [1]. The -h flag can only be tested in combination with -l (which I think shows too much). I suggest replacing this challenge with a different example flag, but I don't know which would work for all platforms?

[1] http://software-carpentry.org/v5/novice/shell/01-filedir.html

jiffyclub commented 9 years ago

At least on Mavericks (OS X 10.9), ls does take a -s flag. See https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/ls.1.html. Not sure about older versions.

BernhardKonrad commented 9 years ago

Hm, weird. Maybe someone with an older version can comment? I know what version the students were running. In fact, I only learned about the problem from the helpers later and from the etherpad chat.

synapticarbors commented 9 years ago

I'm running OSX 10.7.5 and it supports ls -s

BernhardKonrad commented 9 years ago

Thank you Joshua. Since I haven't seen students typing it myself, it seems like the error was not actually a problem with OSX. Better safe than sorry. Thank you for double checking this and identifying the false alarm.

wking commented 9 years ago

On Tue, Aug 26, 2014 at 04:19:50PM -0700, Bernhard Konrad wrote:

Apparently, the Mac terminal does not have a -s flag for ls.

This issue is already closed, but I thought I'd mention that the -s option is in POSIX 1, so we can assume it's cross-platform (and look down our noses at systems that don't support it ;).

drj11 commented 9 years ago

I previously mentioned to @gvwilson that I think -s is pretty obscure (I had to look it up last year). It's also not very useful (unless combined with -k).