Say I have the following folder structure
folder/
├─ subfodler_2/ #User1
├─ subfolder_3/ #User2
├─ subfolder_1/ #User1
where I want to chmod
all the folders (and files) created by User1
to, say, 777.
I know I cant get the files by
ls -la | grep User1
and I know how to chmod
a specific folder, but I don't know how to "use the output" of ls
i.e parse it to chmod
afterwards.
It does not have to be a one-liner if I can write it as a bash-script it would be fine aswell
-maxdepth 1
returns only the folders. THanks a lot – CutePoison Feb 04 '22 at 10:00-type f
will find regular files. that still leaves out all the other stuff, like device nodes, named sockets, pipes and symlinks. Not that it matters here, you can't change the permissions of a symlink itself, and you probably don't have those others. – ilkkachu Feb 04 '22 at 10:16