How do we make sense of this find command? [duplicate]
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
This question already has an answer here:
Understanding the -exec option of `find`
1 answer
find /path/to/wordpress -type f -exec chmod 664 ;
It seems that it find stuffs whose type is file and then exec chmod
What does and
and
;
is for?
find
marked as duplicate by Kusalananda, Michael Homer, Thomas, Romeo Ninov, dr01 Sep 13 at 11:54
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:
Understanding the -exec option of `find`
1 answer
find /path/to/wordpress -type f -exec chmod 664 ;
It seems that it find stuffs whose type is file and then exec chmod
What does and
and
;
is for?
find
marked as duplicate by Kusalananda, Michael Homer, Thomas, Romeo Ninov, dr01 Sep 13 at 11:54
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
up vote
0
down vote
favorite
This question already has an answer here:
Understanding the -exec option of `find`
1 answer
find /path/to/wordpress -type f -exec chmod 664 ;
It seems that it find stuffs whose type is file and then exec chmod
What does and
and
;
is for?
find
This question already has an answer here:
Understanding the -exec option of `find`
1 answer
find /path/to/wordpress -type f -exec chmod 664 ;
It seems that it find stuffs whose type is file and then exec chmod
What does and
and
;
is for?
This question already has an answer here:
Understanding the -exec option of `find`
1 answer
find
find
edited Sep 13 at 9:20
Kusalananda
107k14209331
107k14209331
asked Sep 13 at 9:07
J. Chang
3,221204974
3,221204974
marked as duplicate by Kusalananda, Michael Homer, Thomas, Romeo Ninov, dr01 Sep 13 at 11:54
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 Kusalananda, Michael Homer, Thomas, Romeo Ninov, dr01 Sep 13 at 11:54
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 |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
3
down vote
simply means the file returned by
find
, while ;
it's the terminator.
Please keep in mind that ;
means "execute the command for each file returned by find".
In your case
find /path/to/wordpress -type f -exec chmod 664 ;
means "execute chmod 664
on each file found under /path/to/wordpress
.
For example, if you have
/path/to/wordpress/file1
/path/to/wordpress/file2
/path/to/wordpress/file3
the result is equivalento to call chmod
three times:
chmod 664 /path/to/wordpress/file1
chmod 664 /path/to/wordpress/file2
chmod 664 /path/to/wordpress/file3
You can also terminate the command with +
, which passes every file found as arguments for the command.
With the example above, find /path/to/wordpress -type f -exec chmod 664 +
is equivalent to a single chmod
:
chmod 664 /path/to/wordpress/file1 /path/to/wordpress/file2 /path/to/wordpress/file3
I see and doing it with ; means doing it 3 times
â J. Chang
Sep 13 at 9:16
@J.Chang well, it meas do it for each file, it's 3 times because there are 3 files in the example. If there are 1000 files, it will do it 1000 times ;)
â Mr Shunz
Sep 13 at 9:26
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
simply means the file returned by
find
, while ;
it's the terminator.
Please keep in mind that ;
means "execute the command for each file returned by find".
In your case
find /path/to/wordpress -type f -exec chmod 664 ;
means "execute chmod 664
on each file found under /path/to/wordpress
.
For example, if you have
/path/to/wordpress/file1
/path/to/wordpress/file2
/path/to/wordpress/file3
the result is equivalento to call chmod
three times:
chmod 664 /path/to/wordpress/file1
chmod 664 /path/to/wordpress/file2
chmod 664 /path/to/wordpress/file3
You can also terminate the command with +
, which passes every file found as arguments for the command.
With the example above, find /path/to/wordpress -type f -exec chmod 664 +
is equivalent to a single chmod
:
chmod 664 /path/to/wordpress/file1 /path/to/wordpress/file2 /path/to/wordpress/file3
I see and doing it with ; means doing it 3 times
â J. Chang
Sep 13 at 9:16
@J.Chang well, it meas do it for each file, it's 3 times because there are 3 files in the example. If there are 1000 files, it will do it 1000 times ;)
â Mr Shunz
Sep 13 at 9:26
add a comment |Â
up vote
3
down vote
simply means the file returned by
find
, while ;
it's the terminator.
Please keep in mind that ;
means "execute the command for each file returned by find".
In your case
find /path/to/wordpress -type f -exec chmod 664 ;
means "execute chmod 664
on each file found under /path/to/wordpress
.
For example, if you have
/path/to/wordpress/file1
/path/to/wordpress/file2
/path/to/wordpress/file3
the result is equivalento to call chmod
three times:
chmod 664 /path/to/wordpress/file1
chmod 664 /path/to/wordpress/file2
chmod 664 /path/to/wordpress/file3
You can also terminate the command with +
, which passes every file found as arguments for the command.
With the example above, find /path/to/wordpress -type f -exec chmod 664 +
is equivalent to a single chmod
:
chmod 664 /path/to/wordpress/file1 /path/to/wordpress/file2 /path/to/wordpress/file3
I see and doing it with ; means doing it 3 times
â J. Chang
Sep 13 at 9:16
@J.Chang well, it meas do it for each file, it's 3 times because there are 3 files in the example. If there are 1000 files, it will do it 1000 times ;)
â Mr Shunz
Sep 13 at 9:26
add a comment |Â
up vote
3
down vote
up vote
3
down vote
simply means the file returned by
find
, while ;
it's the terminator.
Please keep in mind that ;
means "execute the command for each file returned by find".
In your case
find /path/to/wordpress -type f -exec chmod 664 ;
means "execute chmod 664
on each file found under /path/to/wordpress
.
For example, if you have
/path/to/wordpress/file1
/path/to/wordpress/file2
/path/to/wordpress/file3
the result is equivalento to call chmod
three times:
chmod 664 /path/to/wordpress/file1
chmod 664 /path/to/wordpress/file2
chmod 664 /path/to/wordpress/file3
You can also terminate the command with +
, which passes every file found as arguments for the command.
With the example above, find /path/to/wordpress -type f -exec chmod 664 +
is equivalent to a single chmod
:
chmod 664 /path/to/wordpress/file1 /path/to/wordpress/file2 /path/to/wordpress/file3
simply means the file returned by
find
, while ;
it's the terminator.
Please keep in mind that ;
means "execute the command for each file returned by find".
In your case
find /path/to/wordpress -type f -exec chmod 664 ;
means "execute chmod 664
on each file found under /path/to/wordpress
.
For example, if you have
/path/to/wordpress/file1
/path/to/wordpress/file2
/path/to/wordpress/file3
the result is equivalento to call chmod
three times:
chmod 664 /path/to/wordpress/file1
chmod 664 /path/to/wordpress/file2
chmod 664 /path/to/wordpress/file3
You can also terminate the command with +
, which passes every file found as arguments for the command.
With the example above, find /path/to/wordpress -type f -exec chmod 664 +
is equivalent to a single chmod
:
chmod 664 /path/to/wordpress/file1 /path/to/wordpress/file2 /path/to/wordpress/file3
answered Sep 13 at 9:13
Mr Shunz
2,65811720
2,65811720
I see and doing it with ; means doing it 3 times
â J. Chang
Sep 13 at 9:16
@J.Chang well, it meas do it for each file, it's 3 times because there are 3 files in the example. If there are 1000 files, it will do it 1000 times ;)
â Mr Shunz
Sep 13 at 9:26
add a comment |Â
I see and doing it with ; means doing it 3 times
â J. Chang
Sep 13 at 9:16
@J.Chang well, it meas do it for each file, it's 3 times because there are 3 files in the example. If there are 1000 files, it will do it 1000 times ;)
â Mr Shunz
Sep 13 at 9:26
I see and doing it with ; means doing it 3 times
â J. Chang
Sep 13 at 9:16
I see and doing it with ; means doing it 3 times
â J. Chang
Sep 13 at 9:16
@J.Chang well, it meas do it for each file, it's 3 times because there are 3 files in the example. If there are 1000 files, it will do it 1000 times ;)
â Mr Shunz
Sep 13 at 9:26
@J.Chang well, it meas do it for each file, it's 3 times because there are 3 files in the example. If there are 1000 files, it will do it 1000 times ;)
â Mr Shunz
Sep 13 at 9:26
add a comment |Â