2

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.

1
  • 1
    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, 2012 at 0:19

1 Answer 1

6

rm -f silences the nonexistent file warning.

You must log in to answer this question.

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