2

Since i do not want to see some of files, i tried to use eshell's ls -I or ls --ignore option.

I first thought that it might behave like GNU ls --hide option but it's not.

It looks that eshell ls does not accept additional parameter.

Can someone show how to use it?

Yung Hee
  • 33
  • 4

1 Answers1

1

Eshell's builtin ls is a lisp function, you can check that via

which ls
eshell/ls is a compiled Lisp function in ‘em-ls.el’

in your *eshell* buffer.

And eshell's builtin ls supports -I or --ignore option exactly, you can check that via

ls --help

in your *eshell* buffer.

Finally, the -I or --ignore option of Eshell's builtin ls command has the same effect with GNU's ls.

But, it's wrong way to using eshell's ls such this:

ls --ignore="<pattern>"
ls -I"<pattern>"

The right way is:

ls --ignore "<pattern>"
ls --ignore "<pattern1>" --ignore "<pattern2>"

The reason that eshell's ls --ignore had no effect with GNU one, because:

If an unrecognized option is passed to this command, the external version ‘/bin/ls’ will be called instead.

and --ignore or --hide had not been supported yet by the ls of BSD.

南山竹
  • 484
  • 8
  • 15