Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

2 Answers

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
add comment

You can create an alias to ls like this:

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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