Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a folder (say, Downloads) with a custom icon.
When I execute cd Downloads and then ls, it displays

Icon?
Subfolder1
Subfolder2

How can I make the ls command skip (thus not showing) the icon files? Maybe a .bash_profile function that overrides ls or something like that?

Thank you!

(PS: I'm on OS X 10.8)

share|improve this question

OS X's ls doesn't have the --ignore option, but you can install the GNU ls with brew install coreutils.

alias ls="gls --ignore $'Icon\r'"
share|improve this answer

You can create an alias to ls like this:

alias ls='ls --ignore=Icon*'
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .