find: ‘echo’: Permission denied
up vote
0
down vote
favorite
It is my os info:
sudo uname -a
Linux machine 4.9.0-8-amd64 #1 SMP Debian 4.9.110-3+deb9u6
(2018-10-08) x86_64 GNU/Linux
Files beginning at test
in /tmp
.
ls -al test*
-rw-r--r-- 1 debian9 debian9 0 Nov 16 14:43 test1
-rw-r--r-- 1 debian9 debian9 0 Nov 16 14:43 test2
-rw-r--r-- 1 debian9 debian9 0 Nov 11 18:28 test.txt
I want to list them with find
.
find /tmp -name "test*" -type f -exec echo {} ;
find: ‘echo’: Permission denied
find: ‘echo’: Permission denied
find: ‘/tmp/snap.0_anbox_tzkdA1’: Permission denied
find: ‘/tmp/systemd-private-589e0bcc99cc438d9e12d06af643af76-apache2.service-J7vefp’: Permission denied
find: ‘/tmp/systemd-private-589e0bcc99cc438d9e12d06af643af76-colord.service-xtmKpt’: Permission denied
find: ‘echo’: Permission denied
find: ‘/tmp/pulse-PKdhtXMmr18n’: Permission denied
find: ‘/tmp/systemd-private-589e0bcc99cc438d9e12d06af643af76-rtkit-daemon.service-rVBMKE’: Permission denied
find: ‘/tmp/systemd-private-589e0bcc99cc438d9e12d06af643af76-dovecot.service-zTKk5O’: Permission denied
Why are so many find: ‘echo’: Permission denied
?
It is no use to run with root
debian9@hwy:/tmp$ su root
Password:
root@hwy:/tmp# find /tmp -name "test*" -type f -exec echo {} ;
find: ‘echo’: Permission denied
find: ‘echo’: Permission denied
find: ‘echo’: Permission denied
find
command can list all files beginning with test
.
find /tmp -name "test*" -type f
/tmp/test2
/tmp/test.txt
/tmp/test1
Why -exec echo {} ;
can't run?
Nothing wrong or something else as output of the below command.
debian9@hwy:~$ sudo find /tmp -name "test*" -type f -exec /bin/echo "{}" ;
Check the permission.
debian9@hwy:~$ sudo ls -al /bin/echo
-rwxr-xr-x 1 root utmp 0 Nov 11 18:05 /bin/echo
linux permissions find echo
add a comment |
up vote
0
down vote
favorite
It is my os info:
sudo uname -a
Linux machine 4.9.0-8-amd64 #1 SMP Debian 4.9.110-3+deb9u6
(2018-10-08) x86_64 GNU/Linux
Files beginning at test
in /tmp
.
ls -al test*
-rw-r--r-- 1 debian9 debian9 0 Nov 16 14:43 test1
-rw-r--r-- 1 debian9 debian9 0 Nov 16 14:43 test2
-rw-r--r-- 1 debian9 debian9 0 Nov 11 18:28 test.txt
I want to list them with find
.
find /tmp -name "test*" -type f -exec echo {} ;
find: ‘echo’: Permission denied
find: ‘echo’: Permission denied
find: ‘/tmp/snap.0_anbox_tzkdA1’: Permission denied
find: ‘/tmp/systemd-private-589e0bcc99cc438d9e12d06af643af76-apache2.service-J7vefp’: Permission denied
find: ‘/tmp/systemd-private-589e0bcc99cc438d9e12d06af643af76-colord.service-xtmKpt’: Permission denied
find: ‘echo’: Permission denied
find: ‘/tmp/pulse-PKdhtXMmr18n’: Permission denied
find: ‘/tmp/systemd-private-589e0bcc99cc438d9e12d06af643af76-rtkit-daemon.service-rVBMKE’: Permission denied
find: ‘/tmp/systemd-private-589e0bcc99cc438d9e12d06af643af76-dovecot.service-zTKk5O’: Permission denied
Why are so many find: ‘echo’: Permission denied
?
It is no use to run with root
debian9@hwy:/tmp$ su root
Password:
root@hwy:/tmp# find /tmp -name "test*" -type f -exec echo {} ;
find: ‘echo’: Permission denied
find: ‘echo’: Permission denied
find: ‘echo’: Permission denied
find
command can list all files beginning with test
.
find /tmp -name "test*" -type f
/tmp/test2
/tmp/test.txt
/tmp/test1
Why -exec echo {} ;
can't run?
Nothing wrong or something else as output of the below command.
debian9@hwy:~$ sudo find /tmp -name "test*" -type f -exec /bin/echo "{}" ;
Check the permission.
debian9@hwy:~$ sudo ls -al /bin/echo
-rwxr-xr-x 1 root utmp 0 Nov 11 18:05 /bin/echo
linux permissions find echo
Every file has ar
permission,you can see the output ofls -al test*
.
– scrapy
Nov 16 at 7:08
How to make it run then?
– scrapy
Nov 16 at 7:15
No use to run it with sudo,it encounter same error info.
– scrapy
Nov 16 at 7:18
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
It is my os info:
sudo uname -a
Linux machine 4.9.0-8-amd64 #1 SMP Debian 4.9.110-3+deb9u6
(2018-10-08) x86_64 GNU/Linux
Files beginning at test
in /tmp
.
ls -al test*
-rw-r--r-- 1 debian9 debian9 0 Nov 16 14:43 test1
-rw-r--r-- 1 debian9 debian9 0 Nov 16 14:43 test2
-rw-r--r-- 1 debian9 debian9 0 Nov 11 18:28 test.txt
I want to list them with find
.
find /tmp -name "test*" -type f -exec echo {} ;
find: ‘echo’: Permission denied
find: ‘echo’: Permission denied
find: ‘/tmp/snap.0_anbox_tzkdA1’: Permission denied
find: ‘/tmp/systemd-private-589e0bcc99cc438d9e12d06af643af76-apache2.service-J7vefp’: Permission denied
find: ‘/tmp/systemd-private-589e0bcc99cc438d9e12d06af643af76-colord.service-xtmKpt’: Permission denied
find: ‘echo’: Permission denied
find: ‘/tmp/pulse-PKdhtXMmr18n’: Permission denied
find: ‘/tmp/systemd-private-589e0bcc99cc438d9e12d06af643af76-rtkit-daemon.service-rVBMKE’: Permission denied
find: ‘/tmp/systemd-private-589e0bcc99cc438d9e12d06af643af76-dovecot.service-zTKk5O’: Permission denied
Why are so many find: ‘echo’: Permission denied
?
It is no use to run with root
debian9@hwy:/tmp$ su root
Password:
root@hwy:/tmp# find /tmp -name "test*" -type f -exec echo {} ;
find: ‘echo’: Permission denied
find: ‘echo’: Permission denied
find: ‘echo’: Permission denied
find
command can list all files beginning with test
.
find /tmp -name "test*" -type f
/tmp/test2
/tmp/test.txt
/tmp/test1
Why -exec echo {} ;
can't run?
Nothing wrong or something else as output of the below command.
debian9@hwy:~$ sudo find /tmp -name "test*" -type f -exec /bin/echo "{}" ;
Check the permission.
debian9@hwy:~$ sudo ls -al /bin/echo
-rwxr-xr-x 1 root utmp 0 Nov 11 18:05 /bin/echo
linux permissions find echo
It is my os info:
sudo uname -a
Linux machine 4.9.0-8-amd64 #1 SMP Debian 4.9.110-3+deb9u6
(2018-10-08) x86_64 GNU/Linux
Files beginning at test
in /tmp
.
ls -al test*
-rw-r--r-- 1 debian9 debian9 0 Nov 16 14:43 test1
-rw-r--r-- 1 debian9 debian9 0 Nov 16 14:43 test2
-rw-r--r-- 1 debian9 debian9 0 Nov 11 18:28 test.txt
I want to list them with find
.
find /tmp -name "test*" -type f -exec echo {} ;
find: ‘echo’: Permission denied
find: ‘echo’: Permission denied
find: ‘/tmp/snap.0_anbox_tzkdA1’: Permission denied
find: ‘/tmp/systemd-private-589e0bcc99cc438d9e12d06af643af76-apache2.service-J7vefp’: Permission denied
find: ‘/tmp/systemd-private-589e0bcc99cc438d9e12d06af643af76-colord.service-xtmKpt’: Permission denied
find: ‘echo’: Permission denied
find: ‘/tmp/pulse-PKdhtXMmr18n’: Permission denied
find: ‘/tmp/systemd-private-589e0bcc99cc438d9e12d06af643af76-rtkit-daemon.service-rVBMKE’: Permission denied
find: ‘/tmp/systemd-private-589e0bcc99cc438d9e12d06af643af76-dovecot.service-zTKk5O’: Permission denied
Why are so many find: ‘echo’: Permission denied
?
It is no use to run with root
debian9@hwy:/tmp$ su root
Password:
root@hwy:/tmp# find /tmp -name "test*" -type f -exec echo {} ;
find: ‘echo’: Permission denied
find: ‘echo’: Permission denied
find: ‘echo’: Permission denied
find
command can list all files beginning with test
.
find /tmp -name "test*" -type f
/tmp/test2
/tmp/test.txt
/tmp/test1
Why -exec echo {} ;
can't run?
Nothing wrong or something else as output of the below command.
debian9@hwy:~$ sudo find /tmp -name "test*" -type f -exec /bin/echo "{}" ;
Check the permission.
debian9@hwy:~$ sudo ls -al /bin/echo
-rwxr-xr-x 1 root utmp 0 Nov 11 18:05 /bin/echo
linux permissions find echo
linux permissions find echo
edited Nov 16 at 10:17
asked Nov 16 at 6:59
scrapy
1765
1765
Every file has ar
permission,you can see the output ofls -al test*
.
– scrapy
Nov 16 at 7:08
How to make it run then?
– scrapy
Nov 16 at 7:15
No use to run it with sudo,it encounter same error info.
– scrapy
Nov 16 at 7:18
add a comment |
Every file has ar
permission,you can see the output ofls -al test*
.
– scrapy
Nov 16 at 7:08
How to make it run then?
– scrapy
Nov 16 at 7:15
No use to run it with sudo,it encounter same error info.
– scrapy
Nov 16 at 7:18
Every file has a
r
permission,you can see the output of ls -al test*
.– scrapy
Nov 16 at 7:08
Every file has a
r
permission,you can see the output of ls -al test*
.– scrapy
Nov 16 at 7:08
How to make it run then?
– scrapy
Nov 16 at 7:15
How to make it run then?
– scrapy
Nov 16 at 7:15
No use to run it with sudo,it encounter same error info.
– scrapy
Nov 16 at 7:18
No use to run it with sudo,it encounter same error info.
– scrapy
Nov 16 at 7:18
add a comment |
3 Answers
3
active
oldest
votes
up vote
1
down vote
accepted
Kamil Maciorowski pointed you in the right direction (hence my +1 for him), but it appears there is something very wrong with your /bin/echo command: here is mine,
# ls -l echo
-rwxr-xr-x 1 root root 35000 gen 18 2018 echo
and here is yours (and I quote):
$ sudo ls -al /bin/echo
-rwxr-xr-x 1 root utmp 0 Nov 11 18:05 /bin/echo
Can you see the differences? Your command belongs to the utmp group, instead of the root group. Also, and equally importantly, its size IS ZERO, while it is 35000 bytes in mine.
So, to be clear: your /bin/echo command is totally empty, and it belongs to the wrong group. This clearly indicates serious corruption of system tools. On the basis of the information provided, there is nothing else I can offer. A clean re-install might be your best option.
There must be something more. In my Debian I created an empty file with exact the same ownership and permissions as the OP's/bin/echo
. It executes successfully (mimicstrue
). A clean re-install may indeed be the best option.
– Kamil Maciorowski
Nov 16 at 11:19
add a comment |
up vote
2
down vote
echo
is a builtin in many shells, so when you use it on a daily basis it just works. However find … -exec echo … ;
uses an external executable like /bin/echo
.
find: ‘echo’: Permission denied
means there's something wrong with permissions of the executable. It may be your $PATH
leads you to some "wrong" echo
or permissions of the "right" echo
are wrong. I'm assuming the latter.
- Locate the executable;
whereis echo
works on many systems. - Check its permissions, like with
ls -l /bin/echo
. - Fix the permissions with
sudo chmod …
. In my Debian they arerwxr-xr-x
(755
). Example command:sudo chmod 755 /bin/echo
.
Nothing wrong or something else as output of the below command.
– scrapy
Nov 16 at 10:18
sudo find /tmp -name "test*" -type f -exec /bin/echo "{}" ;
– scrapy
Nov 16 at 10:19
@scrapy How about if you run it withoutsudo
but still with/bin/echo
?
– Kamil Maciorowski
Nov 16 at 10:56
Pls read my answer too, perhaps you have something to add? Four eyes see better than just two.
– MariusMatutiae
Nov 16 at 11:04
add a comment |
up vote
0
down vote
No need for -exec echo
, in find
you can use -print
(or -ls
if you want more info). In other words:
find $dir -print
and
find $dir -exec echo {} ;
have the same output. This is even the default, if you don't specify a -exec
find $dir -exec echo {} ;
1
A subtlety: the code after the OP says "find
command can list all files beginning withtest
" suggests they know. While-exec echo {} ;
is not really useful, it should work. I read it as a basic example of-exec echo … ;
which in general fails for the OP.
– Kamil Maciorowski
Nov 16 at 8:19
add a comment |
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Kamil Maciorowski pointed you in the right direction (hence my +1 for him), but it appears there is something very wrong with your /bin/echo command: here is mine,
# ls -l echo
-rwxr-xr-x 1 root root 35000 gen 18 2018 echo
and here is yours (and I quote):
$ sudo ls -al /bin/echo
-rwxr-xr-x 1 root utmp 0 Nov 11 18:05 /bin/echo
Can you see the differences? Your command belongs to the utmp group, instead of the root group. Also, and equally importantly, its size IS ZERO, while it is 35000 bytes in mine.
So, to be clear: your /bin/echo command is totally empty, and it belongs to the wrong group. This clearly indicates serious corruption of system tools. On the basis of the information provided, there is nothing else I can offer. A clean re-install might be your best option.
There must be something more. In my Debian I created an empty file with exact the same ownership and permissions as the OP's/bin/echo
. It executes successfully (mimicstrue
). A clean re-install may indeed be the best option.
– Kamil Maciorowski
Nov 16 at 11:19
add a comment |
up vote
1
down vote
accepted
Kamil Maciorowski pointed you in the right direction (hence my +1 for him), but it appears there is something very wrong with your /bin/echo command: here is mine,
# ls -l echo
-rwxr-xr-x 1 root root 35000 gen 18 2018 echo
and here is yours (and I quote):
$ sudo ls -al /bin/echo
-rwxr-xr-x 1 root utmp 0 Nov 11 18:05 /bin/echo
Can you see the differences? Your command belongs to the utmp group, instead of the root group. Also, and equally importantly, its size IS ZERO, while it is 35000 bytes in mine.
So, to be clear: your /bin/echo command is totally empty, and it belongs to the wrong group. This clearly indicates serious corruption of system tools. On the basis of the information provided, there is nothing else I can offer. A clean re-install might be your best option.
There must be something more. In my Debian I created an empty file with exact the same ownership and permissions as the OP's/bin/echo
. It executes successfully (mimicstrue
). A clean re-install may indeed be the best option.
– Kamil Maciorowski
Nov 16 at 11:19
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Kamil Maciorowski pointed you in the right direction (hence my +1 for him), but it appears there is something very wrong with your /bin/echo command: here is mine,
# ls -l echo
-rwxr-xr-x 1 root root 35000 gen 18 2018 echo
and here is yours (and I quote):
$ sudo ls -al /bin/echo
-rwxr-xr-x 1 root utmp 0 Nov 11 18:05 /bin/echo
Can you see the differences? Your command belongs to the utmp group, instead of the root group. Also, and equally importantly, its size IS ZERO, while it is 35000 bytes in mine.
So, to be clear: your /bin/echo command is totally empty, and it belongs to the wrong group. This clearly indicates serious corruption of system tools. On the basis of the information provided, there is nothing else I can offer. A clean re-install might be your best option.
Kamil Maciorowski pointed you in the right direction (hence my +1 for him), but it appears there is something very wrong with your /bin/echo command: here is mine,
# ls -l echo
-rwxr-xr-x 1 root root 35000 gen 18 2018 echo
and here is yours (and I quote):
$ sudo ls -al /bin/echo
-rwxr-xr-x 1 root utmp 0 Nov 11 18:05 /bin/echo
Can you see the differences? Your command belongs to the utmp group, instead of the root group. Also, and equally importantly, its size IS ZERO, while it is 35000 bytes in mine.
So, to be clear: your /bin/echo command is totally empty, and it belongs to the wrong group. This clearly indicates serious corruption of system tools. On the basis of the information provided, there is nothing else I can offer. A clean re-install might be your best option.
answered Nov 16 at 11:03
MariusMatutiae
37.8k95195
37.8k95195
There must be something more. In my Debian I created an empty file with exact the same ownership and permissions as the OP's/bin/echo
. It executes successfully (mimicstrue
). A clean re-install may indeed be the best option.
– Kamil Maciorowski
Nov 16 at 11:19
add a comment |
There must be something more. In my Debian I created an empty file with exact the same ownership and permissions as the OP's/bin/echo
. It executes successfully (mimicstrue
). A clean re-install may indeed be the best option.
– Kamil Maciorowski
Nov 16 at 11:19
There must be something more. In my Debian I created an empty file with exact the same ownership and permissions as the OP's
/bin/echo
. It executes successfully (mimics true
). A clean re-install may indeed be the best option.– Kamil Maciorowski
Nov 16 at 11:19
There must be something more. In my Debian I created an empty file with exact the same ownership and permissions as the OP's
/bin/echo
. It executes successfully (mimics true
). A clean re-install may indeed be the best option.– Kamil Maciorowski
Nov 16 at 11:19
add a comment |
up vote
2
down vote
echo
is a builtin in many shells, so when you use it on a daily basis it just works. However find … -exec echo … ;
uses an external executable like /bin/echo
.
find: ‘echo’: Permission denied
means there's something wrong with permissions of the executable. It may be your $PATH
leads you to some "wrong" echo
or permissions of the "right" echo
are wrong. I'm assuming the latter.
- Locate the executable;
whereis echo
works on many systems. - Check its permissions, like with
ls -l /bin/echo
. - Fix the permissions with
sudo chmod …
. In my Debian they arerwxr-xr-x
(755
). Example command:sudo chmod 755 /bin/echo
.
Nothing wrong or something else as output of the below command.
– scrapy
Nov 16 at 10:18
sudo find /tmp -name "test*" -type f -exec /bin/echo "{}" ;
– scrapy
Nov 16 at 10:19
@scrapy How about if you run it withoutsudo
but still with/bin/echo
?
– Kamil Maciorowski
Nov 16 at 10:56
Pls read my answer too, perhaps you have something to add? Four eyes see better than just two.
– MariusMatutiae
Nov 16 at 11:04
add a comment |
up vote
2
down vote
echo
is a builtin in many shells, so when you use it on a daily basis it just works. However find … -exec echo … ;
uses an external executable like /bin/echo
.
find: ‘echo’: Permission denied
means there's something wrong with permissions of the executable. It may be your $PATH
leads you to some "wrong" echo
or permissions of the "right" echo
are wrong. I'm assuming the latter.
- Locate the executable;
whereis echo
works on many systems. - Check its permissions, like with
ls -l /bin/echo
. - Fix the permissions with
sudo chmod …
. In my Debian they arerwxr-xr-x
(755
). Example command:sudo chmod 755 /bin/echo
.
Nothing wrong or something else as output of the below command.
– scrapy
Nov 16 at 10:18
sudo find /tmp -name "test*" -type f -exec /bin/echo "{}" ;
– scrapy
Nov 16 at 10:19
@scrapy How about if you run it withoutsudo
but still with/bin/echo
?
– Kamil Maciorowski
Nov 16 at 10:56
Pls read my answer too, perhaps you have something to add? Four eyes see better than just two.
– MariusMatutiae
Nov 16 at 11:04
add a comment |
up vote
2
down vote
up vote
2
down vote
echo
is a builtin in many shells, so when you use it on a daily basis it just works. However find … -exec echo … ;
uses an external executable like /bin/echo
.
find: ‘echo’: Permission denied
means there's something wrong with permissions of the executable. It may be your $PATH
leads you to some "wrong" echo
or permissions of the "right" echo
are wrong. I'm assuming the latter.
- Locate the executable;
whereis echo
works on many systems. - Check its permissions, like with
ls -l /bin/echo
. - Fix the permissions with
sudo chmod …
. In my Debian they arerwxr-xr-x
(755
). Example command:sudo chmod 755 /bin/echo
.
echo
is a builtin in many shells, so when you use it on a daily basis it just works. However find … -exec echo … ;
uses an external executable like /bin/echo
.
find: ‘echo’: Permission denied
means there's something wrong with permissions of the executable. It may be your $PATH
leads you to some "wrong" echo
or permissions of the "right" echo
are wrong. I'm assuming the latter.
- Locate the executable;
whereis echo
works on many systems. - Check its permissions, like with
ls -l /bin/echo
. - Fix the permissions with
sudo chmod …
. In my Debian they arerwxr-xr-x
(755
). Example command:sudo chmod 755 /bin/echo
.
answered Nov 16 at 7:57
Kamil Maciorowski
22.7k155072
22.7k155072
Nothing wrong or something else as output of the below command.
– scrapy
Nov 16 at 10:18
sudo find /tmp -name "test*" -type f -exec /bin/echo "{}" ;
– scrapy
Nov 16 at 10:19
@scrapy How about if you run it withoutsudo
but still with/bin/echo
?
– Kamil Maciorowski
Nov 16 at 10:56
Pls read my answer too, perhaps you have something to add? Four eyes see better than just two.
– MariusMatutiae
Nov 16 at 11:04
add a comment |
Nothing wrong or something else as output of the below command.
– scrapy
Nov 16 at 10:18
sudo find /tmp -name "test*" -type f -exec /bin/echo "{}" ;
– scrapy
Nov 16 at 10:19
@scrapy How about if you run it withoutsudo
but still with/bin/echo
?
– Kamil Maciorowski
Nov 16 at 10:56
Pls read my answer too, perhaps you have something to add? Four eyes see better than just two.
– MariusMatutiae
Nov 16 at 11:04
Nothing wrong or something else as output of the below command.
– scrapy
Nov 16 at 10:18
Nothing wrong or something else as output of the below command.
– scrapy
Nov 16 at 10:18
sudo find /tmp -name "test*" -type f -exec /bin/echo "{}" ;
– scrapy
Nov 16 at 10:19
sudo find /tmp -name "test*" -type f -exec /bin/echo "{}" ;
– scrapy
Nov 16 at 10:19
@scrapy How about if you run it without
sudo
but still with /bin/echo
?– Kamil Maciorowski
Nov 16 at 10:56
@scrapy How about if you run it without
sudo
but still with /bin/echo
?– Kamil Maciorowski
Nov 16 at 10:56
Pls read my answer too, perhaps you have something to add? Four eyes see better than just two.
– MariusMatutiae
Nov 16 at 11:04
Pls read my answer too, perhaps you have something to add? Four eyes see better than just two.
– MariusMatutiae
Nov 16 at 11:04
add a comment |
up vote
0
down vote
No need for -exec echo
, in find
you can use -print
(or -ls
if you want more info). In other words:
find $dir -print
and
find $dir -exec echo {} ;
have the same output. This is even the default, if you don't specify a -exec
find $dir -exec echo {} ;
1
A subtlety: the code after the OP says "find
command can list all files beginning withtest
" suggests they know. While-exec echo {} ;
is not really useful, it should work. I read it as a basic example of-exec echo … ;
which in general fails for the OP.
– Kamil Maciorowski
Nov 16 at 8:19
add a comment |
up vote
0
down vote
No need for -exec echo
, in find
you can use -print
(or -ls
if you want more info). In other words:
find $dir -print
and
find $dir -exec echo {} ;
have the same output. This is even the default, if you don't specify a -exec
find $dir -exec echo {} ;
1
A subtlety: the code after the OP says "find
command can list all files beginning withtest
" suggests they know. While-exec echo {} ;
is not really useful, it should work. I read it as a basic example of-exec echo … ;
which in general fails for the OP.
– Kamil Maciorowski
Nov 16 at 8:19
add a comment |
up vote
0
down vote
up vote
0
down vote
No need for -exec echo
, in find
you can use -print
(or -ls
if you want more info). In other words:
find $dir -print
and
find $dir -exec echo {} ;
have the same output. This is even the default, if you don't specify a -exec
find $dir -exec echo {} ;
No need for -exec echo
, in find
you can use -print
(or -ls
if you want more info). In other words:
find $dir -print
and
find $dir -exec echo {} ;
have the same output. This is even the default, if you don't specify a -exec
find $dir -exec echo {} ;
answered Nov 16 at 8:07
xenoid
3,5083618
3,5083618
1
A subtlety: the code after the OP says "find
command can list all files beginning withtest
" suggests they know. While-exec echo {} ;
is not really useful, it should work. I read it as a basic example of-exec echo … ;
which in general fails for the OP.
– Kamil Maciorowski
Nov 16 at 8:19
add a comment |
1
A subtlety: the code after the OP says "find
command can list all files beginning withtest
" suggests they know. While-exec echo {} ;
is not really useful, it should work. I read it as a basic example of-exec echo … ;
which in general fails for the OP.
– Kamil Maciorowski
Nov 16 at 8:19
1
1
A subtlety: the code after the OP says "
find
command can list all files beginning with test
" suggests they know. While -exec echo {} ;
is not really useful, it should work. I read it as a basic example of -exec echo … ;
which in general fails for the OP.– Kamil Maciorowski
Nov 16 at 8:19
A subtlety: the code after the OP says "
find
command can list all files beginning with test
" suggests they know. While -exec echo {} ;
is not really useful, it should work. I read it as a basic example of -exec echo … ;
which in general fails for the OP.– Kamil Maciorowski
Nov 16 at 8:19
add a comment |
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%2fsuperuser.com%2fquestions%2f1375899%2ffind-echo-permission-denied%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
Every file has a
r
permission,you can see the output ofls -al test*
.– scrapy
Nov 16 at 7:08
How to make it run then?
– scrapy
Nov 16 at 7:15
No use to run it with sudo,it encounter same error info.
– scrapy
Nov 16 at 7:18