remove permission spam for find is not working tcsh enviroment
2014-07
Hello this question is asked a lot like here:
However, my environment on (csh or tcsh) seems to add a space but I can't figure out why.
for instance, on bash:
find /. -user `whoami` 2>/dev/null
works just great, but when I go over to tcsh or csh, I get
find: paths must precede expression: 2
Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]
and when I scroll up a command it looks like,
find /. -user `whoami` 2 > /dev/null
Where a space has been put in between the 2 and the stdout sign. Does anyone know why this is being added in my environment? I have no idea where to look.
I'm looking for a Linux command to go through all the directories on my server and find all files with 777 permission. The output would be a list of all those files with full path.
Just like your last question, use find
:
find / -type f -perm 0777
And if you like to find all files without Permission 0777 then just enter a ! before the perm, e.g.
find / -type f ! -perm 0777
You can also change the permissions or ownership of all those files resulting from the find
execution using the -exec
option to avoid change them manually.
Exempli gratia: In a web server you could need to grant the group to write files:
find / -type f -perm 0777 -exec chmod 775 {} \; -exec chgrp -R www {} \;
it's as easy as:
find / -perm 0777
if you only want to match files, use this instead:
find / -type f -perm 0777