Skip to main content
missing --, options after args
Source Link
Stéphane Chazelas
  • 586.8k
  • 96
  • 1.1k
  • 1.7k

More practical, there's a difference between

cd /backup/old; rm * -rf -- *

and

cd /backup/old && rm * -rf -- *

. Besides it's a stupid way, the first one will remove your whole filesystem (or $HOME, depending how it's called) because it runs rm regardless whereverof whether the cd succeeded or not.

More practical, there's a difference between

cd /backup/old; rm * -rf

and

cd /backup/old && rm * -rf

. Besides it's a stupid way, the first one will remove your whole filesystem (or $HOME, depending how it's called) because it runs rm regardless wherever the cd succeeded or not.

More practical, there's a difference between

cd /backup/old; rm -rf -- *

and

cd /backup/old && rm -rf -- *

. Besides it's a stupid way, the first one will remove your whole filesystem (or $HOME, depending how it's called) because it runs rm regardless of whether the cd succeeded or not.

Source Link
Reactormonk
  • 611
  • 1
  • 5
  • 13

More practical, there's a difference between

cd /backup/old; rm * -rf

and

cd /backup/old && rm * -rf

. Besides it's a stupid way, the first one will remove your whole filesystem (or $HOME, depending how it's called) because it runs rm regardless wherever the cd succeeded or not.