Finding lists of files with specific permissionsHow to timestamp a transcripted talk?What are the different...
What is the name for quantum gates that can be reversed?
SQL Always On COPY ONLY backups - what's the point if I cant restore the AG from these backups?
Balm of the Summer Court fey energy dice usage limits
Is Sanskrit really the mother of all languages?
Pronounceable encrypted text
In apex, how to replace the value in the string
Euro sign in table with siunitx
What is the justification for Dirac's large numbers hypothesis?
In-universe, why does Doc Brown program the time machine to go to 1955?
Examples where "thin + thin = nice and thick"
Golfball Dimples on spaceships (and planes)?
How can electricity be positive when electrons are negative?
Old sci fi book, addictive soft drinks
How do I make my fill-in-the-blank exercise more obvious?
Are there mathematical concepts that exist in the fourth dimension, but not in the third dimension?
Was the lunar landing site always in the same plane as the CM's orbit?
Did the Byzantines ever attempt to move their capital to Rome?
What drugs were used in England during the High Middle Ages?
Add builder hat to other people with tikzpeople
Supervisor wants me to support a diploma-thesis SW tool after I graduated
Can my imp familiar still talk when shapshifted (to a raven, if that matters)?
GFI outlets tripped after power outage
How do I write a vertically-stacked definition of a sequence?
Is it right to use the ideas of non-winning designers in a design contest?
Finding lists of files with specific permissions
How to timestamp a transcripted talk?What are the different ways that a message can be displayed to a bash shell after a user logs in?Minecraft server daily restart scriptChanging permissions on an NFS mount + sharing directories with a guest VMPermissions by path instead of file mode bitsprint the output of 2 commands in 1 file on the same lineFile permissions when removing user from gitHow to Change Owner of a Directory`su` command: Permission deniedBash: Count N characters within several alphabetically ordered files
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
I looked into the find command and came up with find . -maxdepth 1 -perm 521 > test.txt
to output the permissions to a text file, but is it possible to do it just using, for example, simple commands like ls
? As far as I know, ls
can't seem to reference permissions specifically so I can't give it a certain permission set to look for.
Is there any other straightforward method I may be overlooking?
bash shell permissions
add a comment |
I looked into the find command and came up with find . -maxdepth 1 -perm 521 > test.txt
to output the permissions to a text file, but is it possible to do it just using, for example, simple commands like ls
? As far as I know, ls
can't seem to reference permissions specifically so I can't give it a certain permission set to look for.
Is there any other straightforward method I may be overlooking?
bash shell permissions
3
What is un-simple about find? It is a bog-standard Unix command.
– vonbrand
Jan 30 '13 at 21:50
if you remove the> test.txt
part, the output will just show on the screen likels
– igrossiter
Jul 9 '16 at 14:43
add a comment |
I looked into the find command and came up with find . -maxdepth 1 -perm 521 > test.txt
to output the permissions to a text file, but is it possible to do it just using, for example, simple commands like ls
? As far as I know, ls
can't seem to reference permissions specifically so I can't give it a certain permission set to look for.
Is there any other straightforward method I may be overlooking?
bash shell permissions
I looked into the find command and came up with find . -maxdepth 1 -perm 521 > test.txt
to output the permissions to a text file, but is it possible to do it just using, for example, simple commands like ls
? As far as I know, ls
can't seem to reference permissions specifically so I can't give it a certain permission set to look for.
Is there any other straightforward method I may be overlooking?
bash shell permissions
bash shell permissions
asked Jan 30 '13 at 21:21
AdamAdam
1081 gold badge2 silver badges8 bronze badges
1081 gold badge2 silver badges8 bronze badges
3
What is un-simple about find? It is a bog-standard Unix command.
– vonbrand
Jan 30 '13 at 21:50
if you remove the> test.txt
part, the output will just show on the screen likels
– igrossiter
Jul 9 '16 at 14:43
add a comment |
3
What is un-simple about find? It is a bog-standard Unix command.
– vonbrand
Jan 30 '13 at 21:50
if you remove the> test.txt
part, the output will just show on the screen likels
– igrossiter
Jul 9 '16 at 14:43
3
3
What is un-simple about find? It is a bog-standard Unix command.
– vonbrand
Jan 30 '13 at 21:50
What is un-simple about find? It is a bog-standard Unix command.
– vonbrand
Jan 30 '13 at 21:50
if you remove the
> test.txt
part, the output will just show on the screen like ls
– igrossiter
Jul 9 '16 at 14:43
if you remove the
> test.txt
part, the output will just show on the screen like ls
– igrossiter
Jul 9 '16 at 14:43
add a comment |
4 Answers
4
active
oldest
votes
Perhaps, you are searching something like:
ls -l | grep '^.r-x-w-r--'
IMHO, there is no tool better than find
to search files. It is simple, straightforward and very powerful. Using find ... -exec ...
or find ... -print0 | xargs -0 ...
, you can easily manipulate, in many ways, files you find. I do not think that you can find any better general purpose tool.
add a comment |
If you don't like find
you might use standard tools like stat
and awk
as follows:
shopt -s dotglob
awk '/^521/ {print $2}' <(stat -c "%a %n" *) > test.txt
You need to set the dotglob
option if hidden files should be included in the expansion of *
.
add a comment |
find
is the straightforward method. If you use zsh, you can use its glob qualifier f
(or a bunch of other qualifiers to characterise permission bits individually).
echo *(f521)
add a comment |
ls -l | grep -e "-rw-r--r--"
use -e for grep it will list all the file with the desired permission
New contributor
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
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: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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/4.0/"u003ecc by-sa 4.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%2funix.stackexchange.com%2fquestions%2f63134%2ffinding-lists-of-files-with-specific-permissions%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
Perhaps, you are searching something like:
ls -l | grep '^.r-x-w-r--'
IMHO, there is no tool better than find
to search files. It is simple, straightforward and very powerful. Using find ... -exec ...
or find ... -print0 | xargs -0 ...
, you can easily manipulate, in many ways, files you find. I do not think that you can find any better general purpose tool.
add a comment |
Perhaps, you are searching something like:
ls -l | grep '^.r-x-w-r--'
IMHO, there is no tool better than find
to search files. It is simple, straightforward and very powerful. Using find ... -exec ...
or find ... -print0 | xargs -0 ...
, you can easily manipulate, in many ways, files you find. I do not think that you can find any better general purpose tool.
add a comment |
Perhaps, you are searching something like:
ls -l | grep '^.r-x-w-r--'
IMHO, there is no tool better than find
to search files. It is simple, straightforward and very powerful. Using find ... -exec ...
or find ... -print0 | xargs -0 ...
, you can easily manipulate, in many ways, files you find. I do not think that you can find any better general purpose tool.
Perhaps, you are searching something like:
ls -l | grep '^.r-x-w-r--'
IMHO, there is no tool better than find
to search files. It is simple, straightforward and very powerful. Using find ... -exec ...
or find ... -print0 | xargs -0 ...
, you can easily manipulate, in many ways, files you find. I do not think that you can find any better general purpose tool.
answered Jan 30 '13 at 22:00
andcozandcoz
13.3k3 gold badges31 silver badges40 bronze badges
13.3k3 gold badges31 silver badges40 bronze badges
add a comment |
add a comment |
If you don't like find
you might use standard tools like stat
and awk
as follows:
shopt -s dotglob
awk '/^521/ {print $2}' <(stat -c "%a %n" *) > test.txt
You need to set the dotglob
option if hidden files should be included in the expansion of *
.
add a comment |
If you don't like find
you might use standard tools like stat
and awk
as follows:
shopt -s dotglob
awk '/^521/ {print $2}' <(stat -c "%a %n" *) > test.txt
You need to set the dotglob
option if hidden files should be included in the expansion of *
.
add a comment |
If you don't like find
you might use standard tools like stat
and awk
as follows:
shopt -s dotglob
awk '/^521/ {print $2}' <(stat -c "%a %n" *) > test.txt
You need to set the dotglob
option if hidden files should be included in the expansion of *
.
If you don't like find
you might use standard tools like stat
and awk
as follows:
shopt -s dotglob
awk '/^521/ {print $2}' <(stat -c "%a %n" *) > test.txt
You need to set the dotglob
option if hidden files should be included in the expansion of *
.
edited Jan 30 '13 at 22:44
answered Jan 30 '13 at 22:12
user13742
add a comment |
add a comment |
find
is the straightforward method. If you use zsh, you can use its glob qualifier f
(or a bunch of other qualifiers to characterise permission bits individually).
echo *(f521)
add a comment |
find
is the straightforward method. If you use zsh, you can use its glob qualifier f
(or a bunch of other qualifiers to characterise permission bits individually).
echo *(f521)
add a comment |
find
is the straightforward method. If you use zsh, you can use its glob qualifier f
(or a bunch of other qualifiers to characterise permission bits individually).
echo *(f521)
find
is the straightforward method. If you use zsh, you can use its glob qualifier f
(or a bunch of other qualifiers to characterise permission bits individually).
echo *(f521)
answered Jan 31 '13 at 23:51
GillesGilles
573k139 gold badges1183 silver badges1695 bronze badges
573k139 gold badges1183 silver badges1695 bronze badges
add a comment |
add a comment |
ls -l | grep -e "-rw-r--r--"
use -e for grep it will list all the file with the desired permission
New contributor
add a comment |
ls -l | grep -e "-rw-r--r--"
use -e for grep it will list all the file with the desired permission
New contributor
add a comment |
ls -l | grep -e "-rw-r--r--"
use -e for grep it will list all the file with the desired permission
New contributor
ls -l | grep -e "-rw-r--r--"
use -e for grep it will list all the file with the desired permission
New contributor
New contributor
answered 59 mins ago
user370349user370349
1
1
New contributor
New contributor
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- 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%2funix.stackexchange.com%2fquestions%2f63134%2ffinding-lists-of-files-with-specific-permissions%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
3
What is un-simple about find? It is a bog-standard Unix command.
– vonbrand
Jan 30 '13 at 21:50
if you remove the
> test.txt
part, the output will just show on the screen likels
– igrossiter
Jul 9 '16 at 14:43