Not found argument in -exec [duplicate]
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
This question already has an answer here:
How to run find -exec?
6 answers
I have such a problem, I'm trying to output a list of movies without the names of directories in the file, but I have a bug, the argument is not found in the -exeÃÂ
, below is the code
$ find . -name "*.avi" -o -name "*.mkv" -exec basename > ~/Bash/test/rm/films.txt
linux command-line find
marked as duplicate by Jesse_b, Christopher, Community⦠Feb 26 at 16:46
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |Â
up vote
0
down vote
favorite
This question already has an answer here:
How to run find -exec?
6 answers
I have such a problem, I'm trying to output a list of movies without the names of directories in the file, but I have a bug, the argument is not found in the -exeÃÂ
, below is the code
$ find . -name "*.avi" -o -name "*.mkv" -exec basename > ~/Bash/test/rm/films.txt
linux command-line find
marked as duplicate by Jesse_b, Christopher, Community⦠Feb 26 at 16:46
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
find: there is no argument to "-exec"
â ÃÂüøÃÂÃÂøù áüøÃÂýþò
Feb 26 at 16:27
you're missing a;
. Also it appears to work for me but I don't believe there is any reason to escape
â Jesse_b
Feb 26 at 16:30
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
This question already has an answer here:
How to run find -exec?
6 answers
I have such a problem, I'm trying to output a list of movies without the names of directories in the file, but I have a bug, the argument is not found in the -exeÃÂ
, below is the code
$ find . -name "*.avi" -o -name "*.mkv" -exec basename > ~/Bash/test/rm/films.txt
linux command-line find
This question already has an answer here:
How to run find -exec?
6 answers
I have such a problem, I'm trying to output a list of movies without the names of directories in the file, but I have a bug, the argument is not found in the -exeÃÂ
, below is the code
$ find . -name "*.avi" -o -name "*.mkv" -exec basename > ~/Bash/test/rm/films.txt
This question already has an answer here:
How to run find -exec?
6 answers
linux command-line find
edited Feb 26 at 16:29
Jeff Schaller
31.2k846105
31.2k846105
asked Feb 26 at 16:26
ÃÂüøÃÂÃÂøù áüøÃÂýþò
31
31
marked as duplicate by Jesse_b, Christopher, Community⦠Feb 26 at 16:46
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by Jesse_b, Christopher, Community⦠Feb 26 at 16:46
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
find: there is no argument to "-exec"
â ÃÂüøÃÂÃÂøù áüøÃÂýþò
Feb 26 at 16:27
you're missing a;
. Also it appears to work for me but I don't believe there is any reason to escape
â Jesse_b
Feb 26 at 16:30
add a comment |Â
find: there is no argument to "-exec"
â ÃÂüøÃÂÃÂøù áüøÃÂýþò
Feb 26 at 16:27
you're missing a;
. Also it appears to work for me but I don't believe there is any reason to escape
â Jesse_b
Feb 26 at 16:30
find: there is no argument to "-exec"
â ÃÂüøÃÂÃÂøù áüøÃÂýþò
Feb 26 at 16:27
find: there is no argument to "-exec"
â ÃÂüøÃÂÃÂøù áüøÃÂýþò
Feb 26 at 16:27
you're missing a
;
. Also it appears to work for me but I don't believe there is any reason to escape
â Jesse_b
Feb 26 at 16:30
you're missing a
;
. Also it appears to work for me but I don't believe there is any reason to escape
â Jesse_b
Feb 26 at 16:30
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
3
down vote
accepted
Try this instead :
$ find . ( -name "*.avi" -o -name "*.mkv" ) -exec basename ; > ~/Bash/test/rm/films.txt
I tried, the same thing
â ÃÂüøÃÂÃÂøù áüøÃÂýþò
Feb 26 at 16:32
Thank you very much, your change worked, I so wanted to do, but I thought that after ";" code will not work anymore, Thanks again, your answer is the best
â ÃÂüøÃÂÃÂøù áüøÃÂýþò
Feb 26 at 16:45
When you have multiple conditions, you should use parentheses like here, it's mandatory
â Gilles Quenot
Feb 26 at 16:49
@GillesQuenot It's only "mandatory" if the precedence of the conditions (OR/AND) matter.
â Kusalananda
Feb 26 at 16:50
@Kusalananda: I agree
â Gilles Quenot
Feb 26 at 16:51
 |Â
show 1 more comment
up vote
4
down vote
There are two typos in your command.
should be
The
â£
(backslash+space) should be;
or';'
.
The -exec
option/predicate of find
needs to know where the command that it executes ends. It is told this by the ;
at the end (which needs to be quoted to protect it from the shell).
You should not need to escape or quote .
There might be some issues with precedence too. You basically say
condition OR condition AND run-this-command
which is ambiguous. It would be better to say
(condition OR condition) AND run-this-command
This does that:
find . -type f '(' -name '*.avi' -o -name '*.mkv' ')'
-exec basename ';' > ~/Bash/test/rm/films.txt
I've also added -type f
so that only regular files are considered.
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
Try this instead :
$ find . ( -name "*.avi" -o -name "*.mkv" ) -exec basename ; > ~/Bash/test/rm/films.txt
I tried, the same thing
â ÃÂüøÃÂÃÂøù áüøÃÂýþò
Feb 26 at 16:32
Thank you very much, your change worked, I so wanted to do, but I thought that after ";" code will not work anymore, Thanks again, your answer is the best
â ÃÂüøÃÂÃÂøù áüøÃÂýþò
Feb 26 at 16:45
When you have multiple conditions, you should use parentheses like here, it's mandatory
â Gilles Quenot
Feb 26 at 16:49
@GillesQuenot It's only "mandatory" if the precedence of the conditions (OR/AND) matter.
â Kusalananda
Feb 26 at 16:50
@Kusalananda: I agree
â Gilles Quenot
Feb 26 at 16:51
 |Â
show 1 more comment
up vote
3
down vote
accepted
Try this instead :
$ find . ( -name "*.avi" -o -name "*.mkv" ) -exec basename ; > ~/Bash/test/rm/films.txt
I tried, the same thing
â ÃÂüøÃÂÃÂøù áüøÃÂýþò
Feb 26 at 16:32
Thank you very much, your change worked, I so wanted to do, but I thought that after ";" code will not work anymore, Thanks again, your answer is the best
â ÃÂüøÃÂÃÂøù áüøÃÂýþò
Feb 26 at 16:45
When you have multiple conditions, you should use parentheses like here, it's mandatory
â Gilles Quenot
Feb 26 at 16:49
@GillesQuenot It's only "mandatory" if the precedence of the conditions (OR/AND) matter.
â Kusalananda
Feb 26 at 16:50
@Kusalananda: I agree
â Gilles Quenot
Feb 26 at 16:51
 |Â
show 1 more comment
up vote
3
down vote
accepted
up vote
3
down vote
accepted
Try this instead :
$ find . ( -name "*.avi" -o -name "*.mkv" ) -exec basename ; > ~/Bash/test/rm/films.txt
Try this instead :
$ find . ( -name "*.avi" -o -name "*.mkv" ) -exec basename ; > ~/Bash/test/rm/films.txt
edited Feb 26 at 16:44
answered Feb 26 at 16:30
Gilles Quenot
15.3k13448
15.3k13448
I tried, the same thing
â ÃÂüøÃÂÃÂøù áüøÃÂýþò
Feb 26 at 16:32
Thank you very much, your change worked, I so wanted to do, but I thought that after ";" code will not work anymore, Thanks again, your answer is the best
â ÃÂüøÃÂÃÂøù áüøÃÂýþò
Feb 26 at 16:45
When you have multiple conditions, you should use parentheses like here, it's mandatory
â Gilles Quenot
Feb 26 at 16:49
@GillesQuenot It's only "mandatory" if the precedence of the conditions (OR/AND) matter.
â Kusalananda
Feb 26 at 16:50
@Kusalananda: I agree
â Gilles Quenot
Feb 26 at 16:51
 |Â
show 1 more comment
I tried, the same thing
â ÃÂüøÃÂÃÂøù áüøÃÂýþò
Feb 26 at 16:32
Thank you very much, your change worked, I so wanted to do, but I thought that after ";" code will not work anymore, Thanks again, your answer is the best
â ÃÂüøÃÂÃÂøù áüøÃÂýþò
Feb 26 at 16:45
When you have multiple conditions, you should use parentheses like here, it's mandatory
â Gilles Quenot
Feb 26 at 16:49
@GillesQuenot It's only "mandatory" if the precedence of the conditions (OR/AND) matter.
â Kusalananda
Feb 26 at 16:50
@Kusalananda: I agree
â Gilles Quenot
Feb 26 at 16:51
I tried, the same thing
â ÃÂüøÃÂÃÂøù áüøÃÂýþò
Feb 26 at 16:32
I tried, the same thing
â ÃÂüøÃÂÃÂøù áüøÃÂýþò
Feb 26 at 16:32
Thank you very much, your change worked, I so wanted to do, but I thought that after ";" code will not work anymore, Thanks again, your answer is the best
â ÃÂüøÃÂÃÂøù áüøÃÂýþò
Feb 26 at 16:45
Thank you very much, your change worked, I so wanted to do, but I thought that after ";" code will not work anymore, Thanks again, your answer is the best
â ÃÂüøÃÂÃÂøù áüøÃÂýþò
Feb 26 at 16:45
When you have multiple conditions, you should use parentheses like here, it's mandatory
â Gilles Quenot
Feb 26 at 16:49
When you have multiple conditions, you should use parentheses like here, it's mandatory
â Gilles Quenot
Feb 26 at 16:49
@GillesQuenot It's only "mandatory" if the precedence of the conditions (OR/AND) matter.
â Kusalananda
Feb 26 at 16:50
@GillesQuenot It's only "mandatory" if the precedence of the conditions (OR/AND) matter.
â Kusalananda
Feb 26 at 16:50
@Kusalananda: I agree
â Gilles Quenot
Feb 26 at 16:51
@Kusalananda: I agree
â Gilles Quenot
Feb 26 at 16:51
 |Â
show 1 more comment
up vote
4
down vote
There are two typos in your command.
should be
The
â£
(backslash+space) should be;
or';'
.
The -exec
option/predicate of find
needs to know where the command that it executes ends. It is told this by the ;
at the end (which needs to be quoted to protect it from the shell).
You should not need to escape or quote .
There might be some issues with precedence too. You basically say
condition OR condition AND run-this-command
which is ambiguous. It would be better to say
(condition OR condition) AND run-this-command
This does that:
find . -type f '(' -name '*.avi' -o -name '*.mkv' ')'
-exec basename ';' > ~/Bash/test/rm/films.txt
I've also added -type f
so that only regular files are considered.
add a comment |Â
up vote
4
down vote
There are two typos in your command.
should be
The
â£
(backslash+space) should be;
or';'
.
The -exec
option/predicate of find
needs to know where the command that it executes ends. It is told this by the ;
at the end (which needs to be quoted to protect it from the shell).
You should not need to escape or quote .
There might be some issues with precedence too. You basically say
condition OR condition AND run-this-command
which is ambiguous. It would be better to say
(condition OR condition) AND run-this-command
This does that:
find . -type f '(' -name '*.avi' -o -name '*.mkv' ')'
-exec basename ';' > ~/Bash/test/rm/films.txt
I've also added -type f
so that only regular files are considered.
add a comment |Â
up vote
4
down vote
up vote
4
down vote
There are two typos in your command.
should be
The
â£
(backslash+space) should be;
or';'
.
The -exec
option/predicate of find
needs to know where the command that it executes ends. It is told this by the ;
at the end (which needs to be quoted to protect it from the shell).
You should not need to escape or quote .
There might be some issues with precedence too. You basically say
condition OR condition AND run-this-command
which is ambiguous. It would be better to say
(condition OR condition) AND run-this-command
This does that:
find . -type f '(' -name '*.avi' -o -name '*.mkv' ')'
-exec basename ';' > ~/Bash/test/rm/films.txt
I've also added -type f
so that only regular files are considered.
There are two typos in your command.
should be
The
â£
(backslash+space) should be;
or';'
.
The -exec
option/predicate of find
needs to know where the command that it executes ends. It is told this by the ;
at the end (which needs to be quoted to protect it from the shell).
You should not need to escape or quote .
There might be some issues with precedence too. You basically say
condition OR condition AND run-this-command
which is ambiguous. It would be better to say
(condition OR condition) AND run-this-command
This does that:
find . -type f '(' -name '*.avi' -o -name '*.mkv' ')'
-exec basename ';' > ~/Bash/test/rm/films.txt
I've also added -type f
so that only regular files are considered.
edited Feb 26 at 16:48
answered Feb 26 at 16:30
Kusalananda
103k13202318
103k13202318
add a comment |Â
add a comment |Â
find: there is no argument to "-exec"
â ÃÂüøÃÂÃÂøù áüøÃÂýþò
Feb 26 at 16:27
you're missing a
;
. Also it appears to work for me but I don't believe there is any reason to escapeâ Jesse_b
Feb 26 at 16:30