What's wrong with this 'find' command?
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?
command-line delete find
add a comment |
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?
command-line delete find
add a comment |
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?
command-line delete find
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?
command-line delete find
command-line delete find
edited Jan 3 at 9:04


Zanna
50.4k13133241
50.4k13133241
asked Jan 1 at 18:40


DoradDorad
1736
1736
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You have typographic sign –
instead of minus (-
).
Change your command to
find . -type f -name "*.ts" -delete
For complete syntax see man find
:
ACTIONS
-delete
Delete files; true if removal succeeded. If the removal failed, an error message is issued.
If-delete
fails,find
's exit status will be nonzero (when it eventually exits).
Use of-delete
automatically turns on the-depth
option.
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.
9
And some blogs may rely on your copying to attack your computer.
– AuxTaco
Jan 2 at 8:10
In this particular case we do not know the source of this command. If original author wrongly had--
then engine converted it to–
. So we do not know the whole story :)
– N0rbert
Jan 2 at 11:04
2
I can tell the story: I copy-pasted it from terminal to a MS Word document consisted of command set to deploy our server. MS Word is auto-fixing the dash in some cases. Then a year or some after i copied that command and the question opened... Thanks.
– Dorad
Jan 2 at 14:48
1
It's probably better to use Notepad++ in this situation, rather than Word.
– Davidw
Jan 2 at 22:41
1
Never use a word processor to edit code. That's (a big reason) why there are still text editors. The last thing you need is substituted characters, or word wrap.
– Joe
Jan 3 at 12:34
|
show 1 more comment
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1106070%2fwhats-wrong-with-this-find-command%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You have typographic sign –
instead of minus (-
).
Change your command to
find . -type f -name "*.ts" -delete
For complete syntax see man find
:
ACTIONS
-delete
Delete files; true if removal succeeded. If the removal failed, an error message is issued.
If-delete
fails,find
's exit status will be nonzero (when it eventually exits).
Use of-delete
automatically turns on the-depth
option.
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.
9
And some blogs may rely on your copying to attack your computer.
– AuxTaco
Jan 2 at 8:10
In this particular case we do not know the source of this command. If original author wrongly had--
then engine converted it to–
. So we do not know the whole story :)
– N0rbert
Jan 2 at 11:04
2
I can tell the story: I copy-pasted it from terminal to a MS Word document consisted of command set to deploy our server. MS Word is auto-fixing the dash in some cases. Then a year or some after i copied that command and the question opened... Thanks.
– Dorad
Jan 2 at 14:48
1
It's probably better to use Notepad++ in this situation, rather than Word.
– Davidw
Jan 2 at 22:41
1
Never use a word processor to edit code. That's (a big reason) why there are still text editors. The last thing you need is substituted characters, or word wrap.
– Joe
Jan 3 at 12:34
|
show 1 more comment
You have typographic sign –
instead of minus (-
).
Change your command to
find . -type f -name "*.ts" -delete
For complete syntax see man find
:
ACTIONS
-delete
Delete files; true if removal succeeded. If the removal failed, an error message is issued.
If-delete
fails,find
's exit status will be nonzero (when it eventually exits).
Use of-delete
automatically turns on the-depth
option.
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.
9
And some blogs may rely on your copying to attack your computer.
– AuxTaco
Jan 2 at 8:10
In this particular case we do not know the source of this command. If original author wrongly had--
then engine converted it to–
. So we do not know the whole story :)
– N0rbert
Jan 2 at 11:04
2
I can tell the story: I copy-pasted it from terminal to a MS Word document consisted of command set to deploy our server. MS Word is auto-fixing the dash in some cases. Then a year or some after i copied that command and the question opened... Thanks.
– Dorad
Jan 2 at 14:48
1
It's probably better to use Notepad++ in this situation, rather than Word.
– Davidw
Jan 2 at 22:41
1
Never use a word processor to edit code. That's (a big reason) why there are still text editors. The last thing you need is substituted characters, or word wrap.
– Joe
Jan 3 at 12:34
|
show 1 more comment
You have typographic sign –
instead of minus (-
).
Change your command to
find . -type f -name "*.ts" -delete
For complete syntax see man find
:
ACTIONS
-delete
Delete files; true if removal succeeded. If the removal failed, an error message is issued.
If-delete
fails,find
's exit status will be nonzero (when it eventually exits).
Use of-delete
automatically turns on the-depth
option.
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.
You have typographic sign –
instead of minus (-
).
Change your command to
find . -type f -name "*.ts" -delete
For complete syntax see man find
:
ACTIONS
-delete
Delete files; true if removal succeeded. If the removal failed, an error message is issued.
If-delete
fails,find
's exit status will be nonzero (when it eventually exits).
Use of-delete
automatically turns on the-depth
option.
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.
edited Jan 3 at 7:00
answered Jan 1 at 18:43
N0rbertN0rbert
21.7k547101
21.7k547101
9
And some blogs may rely on your copying to attack your computer.
– AuxTaco
Jan 2 at 8:10
In this particular case we do not know the source of this command. If original author wrongly had--
then engine converted it to–
. So we do not know the whole story :)
– N0rbert
Jan 2 at 11:04
2
I can tell the story: I copy-pasted it from terminal to a MS Word document consisted of command set to deploy our server. MS Word is auto-fixing the dash in some cases. Then a year or some after i copied that command and the question opened... Thanks.
– Dorad
Jan 2 at 14:48
1
It's probably better to use Notepad++ in this situation, rather than Word.
– Davidw
Jan 2 at 22:41
1
Never use a word processor to edit code. That's (a big reason) why there are still text editors. The last thing you need is substituted characters, or word wrap.
– Joe
Jan 3 at 12:34
|
show 1 more comment
9
And some blogs may rely on your copying to attack your computer.
– AuxTaco
Jan 2 at 8:10
In this particular case we do not know the source of this command. If original author wrongly had--
then engine converted it to–
. So we do not know the whole story :)
– N0rbert
Jan 2 at 11:04
2
I can tell the story: I copy-pasted it from terminal to a MS Word document consisted of command set to deploy our server. MS Word is auto-fixing the dash in some cases. Then a year or some after i copied that command and the question opened... Thanks.
– Dorad
Jan 2 at 14:48
1
It's probably better to use Notepad++ in this situation, rather than Word.
– Davidw
Jan 2 at 22:41
1
Never use a word processor to edit code. That's (a big reason) why there are still text editors. The last thing you need is substituted characters, or word wrap.
– Joe
Jan 3 at 12:34
9
9
And some blogs may rely on your copying to attack your computer.
– AuxTaco
Jan 2 at 8:10
And some blogs may rely on your copying to attack your computer.
– AuxTaco
Jan 2 at 8:10
In this particular case we do not know the source of this command. If original author wrongly had
--
then engine converted it to –
. So we do not know the whole story :)– N0rbert
Jan 2 at 11:04
In this particular case we do not know the source of this command. If original author wrongly had
--
then engine converted it to –
. So we do not know the whole story :)– N0rbert
Jan 2 at 11:04
2
2
I can tell the story: I copy-pasted it from terminal to a MS Word document consisted of command set to deploy our server. MS Word is auto-fixing the dash in some cases. Then a year or some after i copied that command and the question opened... Thanks.
– Dorad
Jan 2 at 14:48
I can tell the story: I copy-pasted it from terminal to a MS Word document consisted of command set to deploy our server. MS Word is auto-fixing the dash in some cases. Then a year or some after i copied that command and the question opened... Thanks.
– Dorad
Jan 2 at 14:48
1
1
It's probably better to use Notepad++ in this situation, rather than Word.
– Davidw
Jan 2 at 22:41
It's probably better to use Notepad++ in this situation, rather than Word.
– Davidw
Jan 2 at 22:41
1
1
Never use a word processor to edit code. That's (a big reason) why there are still text editors. The last thing you need is substituted characters, or word wrap.
– Joe
Jan 3 at 12:34
Never use a word processor to edit code. That's (a big reason) why there are still text editors. The last thing you need is substituted characters, or word wrap.
– Joe
Jan 3 at 12:34
|
show 1 more comment
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1106070%2fwhats-wrong-with-this-find-command%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown