I am executing the following command (to find all files with
.ts extension and deleting them):
find . -type f -name "*.ts" –delete
An error shows up:
find: paths must precede expression: `–delete'
What have I done wrong?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
You have typographic sign
– instead of minus (
Change your command to
find . -type f -name "*.ts" -delete
For complete syntax see
Delete files; true if removal succeeded. If the removal failed, an error message is issued.
find's exit status will be nonzero (when it eventually exits).
-deleteautomatically turns on the
Be careful with copying and pasting commands from blogs and rich text processors. They may transform some typographic symbols to their plain text equivalents and vice versa.
Consider to use simple text editors for the notes next time - use plain text, Markdown or reStructuredText.
And as @AuxTaco mentioned - some blogs may rely on your copying to attack your computer.