POSIX find all non readable files
Clash Royale CLAN TAG#URR8PPP
up vote
4
down vote
favorite
I am trying to find all non readable 'ACL-wise' in a subdirectory owned by another user www-data
, and that on a 'FreeBSD' server. This server prevents me from using the command find . ! -readable
How could I find all the non-readable (by the current user) files in a directory?
find posix
New contributor
Pierre-Antoine Guillaume is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
4
down vote
favorite
I am trying to find all non readable 'ACL-wise' in a subdirectory owned by another user www-data
, and that on a 'FreeBSD' server. This server prevents me from using the command find . ! -readable
How could I find all the non-readable (by the current user) files in a directory?
find posix
New contributor
Pierre-Antoine Guillaume is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Similar: How to recursively check if a specfic user has read access to a folder and its contents?
– Stéphane Chazelas
8 hours ago
add a comment |Â
up vote
4
down vote
favorite
up vote
4
down vote
favorite
I am trying to find all non readable 'ACL-wise' in a subdirectory owned by another user www-data
, and that on a 'FreeBSD' server. This server prevents me from using the command find . ! -readable
How could I find all the non-readable (by the current user) files in a directory?
find posix
New contributor
Pierre-Antoine Guillaume is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I am trying to find all non readable 'ACL-wise' in a subdirectory owned by another user www-data
, and that on a 'FreeBSD' server. This server prevents me from using the command find . ! -readable
How could I find all the non-readable (by the current user) files in a directory?
find posix
find posix
New contributor
Pierre-Antoine Guillaume is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Pierre-Antoine Guillaume is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited 4 hours ago


Stéphane Chazelas
283k53522859
283k53522859
New contributor
Pierre-Antoine Guillaume is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 8 hours ago


Pierre-Antoine Guillaume
213
213
New contributor
Pierre-Antoine Guillaume is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Pierre-Antoine Guillaume is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Pierre-Antoine Guillaume is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Similar: How to recursively check if a specfic user has read access to a folder and its contents?
– Stéphane Chazelas
8 hours ago
add a comment |Â
Similar: How to recursively check if a specfic user has read access to a folder and its contents?
– Stéphane Chazelas
8 hours ago
Similar: How to recursively check if a specfic user has read access to a folder and its contents?
– Stéphane Chazelas
8 hours ago
Similar: How to recursively check if a specfic user has read access to a folder and its contents?
– Stéphane Chazelas
8 hours ago
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
7
down vote
You can always do:
find . -exec sh -c '
for file do
[ -r "$file" ] || printf "%sn" "$file"
done' sh +
To list the files you don't have read permission for.
Note that for symlinks, that checks the target of the symlink.
It also obviously won't report files in directories you don't have read permission to (which may contain files you have read access to (provided you have search access to the directory) and/or files you don't have read access to).
On FreeBSD, you should also be able to do:
find . -print0 | perl -Mfiletest=access -l -0ne 'print unless -r'
Or
sudo find . -print0 | perl -Mfiletest=access -l -0ne 'print unless -r'
To also list the files in the directories you don't have read access to.
(neither sudo
, -print0
nor perl
are specified by POSIX).
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
7
down vote
You can always do:
find . -exec sh -c '
for file do
[ -r "$file" ] || printf "%sn" "$file"
done' sh +
To list the files you don't have read permission for.
Note that for symlinks, that checks the target of the symlink.
It also obviously won't report files in directories you don't have read permission to (which may contain files you have read access to (provided you have search access to the directory) and/or files you don't have read access to).
On FreeBSD, you should also be able to do:
find . -print0 | perl -Mfiletest=access -l -0ne 'print unless -r'
Or
sudo find . -print0 | perl -Mfiletest=access -l -0ne 'print unless -r'
To also list the files in the directories you don't have read access to.
(neither sudo
, -print0
nor perl
are specified by POSIX).
add a comment |Â
up vote
7
down vote
You can always do:
find . -exec sh -c '
for file do
[ -r "$file" ] || printf "%sn" "$file"
done' sh +
To list the files you don't have read permission for.
Note that for symlinks, that checks the target of the symlink.
It also obviously won't report files in directories you don't have read permission to (which may contain files you have read access to (provided you have search access to the directory) and/or files you don't have read access to).
On FreeBSD, you should also be able to do:
find . -print0 | perl -Mfiletest=access -l -0ne 'print unless -r'
Or
sudo find . -print0 | perl -Mfiletest=access -l -0ne 'print unless -r'
To also list the files in the directories you don't have read access to.
(neither sudo
, -print0
nor perl
are specified by POSIX).
add a comment |Â
up vote
7
down vote
up vote
7
down vote
You can always do:
find . -exec sh -c '
for file do
[ -r "$file" ] || printf "%sn" "$file"
done' sh +
To list the files you don't have read permission for.
Note that for symlinks, that checks the target of the symlink.
It also obviously won't report files in directories you don't have read permission to (which may contain files you have read access to (provided you have search access to the directory) and/or files you don't have read access to).
On FreeBSD, you should also be able to do:
find . -print0 | perl -Mfiletest=access -l -0ne 'print unless -r'
Or
sudo find . -print0 | perl -Mfiletest=access -l -0ne 'print unless -r'
To also list the files in the directories you don't have read access to.
(neither sudo
, -print0
nor perl
are specified by POSIX).
You can always do:
find . -exec sh -c '
for file do
[ -r "$file" ] || printf "%sn" "$file"
done' sh +
To list the files you don't have read permission for.
Note that for symlinks, that checks the target of the symlink.
It also obviously won't report files in directories you don't have read permission to (which may contain files you have read access to (provided you have search access to the directory) and/or files you don't have read access to).
On FreeBSD, you should also be able to do:
find . -print0 | perl -Mfiletest=access -l -0ne 'print unless -r'
Or
sudo find . -print0 | perl -Mfiletest=access -l -0ne 'print unless -r'
To also list the files in the directories you don't have read access to.
(neither sudo
, -print0
nor perl
are specified by POSIX).
edited 7 hours ago
answered 8 hours ago


Stéphane Chazelas
283k53522859
283k53522859
add a comment |Â
add a comment |Â
Pierre-Antoine Guillaume is a new contributor. Be nice, and check out our Code of Conduct.
Pierre-Antoine Guillaume is a new contributor. Be nice, and check out our Code of Conduct.
Pierre-Antoine Guillaume is a new contributor. Be nice, and check out our Code of Conduct.
Pierre-Antoine Guillaume is a new contributor. Be nice, and check out our Code of Conduct.
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f468736%2fposix-find-all-non-readable-files%23new-answer', 'question_page');
);
Post as a guest
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
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
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
Similar: How to recursively check if a specfic user has read access to a folder and its contents?
– Stéphane Chazelas
8 hours ago