4

I have a directory called selenium_IDE

if I do

ls sel* 

I get to see directories that are in it, e.g.

$ ls sel*
HAPPY              HAPPY_PLUS_OPTIONS SAD                SAD_PLUS_OPTIONS

but not the directory itself, i.e. selenium_IDE/

I tried using -d1 (depth 1) which has worked for me in the past on some system. It does work in that it shows the selenium_IDE directory but also shows a error here on OSX

$ ls sel* -d1
ls: -d1: No such file or directory
selenium_IDE:
HAPPY              HAPPY_PLUS_OPTIONS SAD                SAD_PLUS_OPTIONS
16

Accepting command options arguments after file operands is not standard and isn't often supported in non-GNU system, you need:

ls -d1 sel*

A note that -d1 isn't depth 1 like you think.

  • -d tell ls list directories themselves, not their content
  • -1 tell ls list one entry per line

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.