Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

Here is a part of my zshrc file.

## Most Frequently used settings
# ls
alias ls='rm .DS_Store; echo --------------${PWD##*/}--------------; ls -1FGu'
alias l='ls -A'

I want to delete .DS_Store, every time I ls, if it exists, but, if it doesn't, I don't want warning from rm.

share|improve this question
I dont think this is a particular good idea to have a (typical) side effect free command modified this way. You could add a auto mount script, so this is done only once you plug a device in. But then again if a friend of yours wants to peek on his flash drive he might not be happy about losing his Apple settings. , but yes rm -f – eckes Aug 16 '12 at 0:19
up vote 3 down vote accepted

rm -f silences the nonexistent file warning.

share|improve this answer

Your Answer


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.