I now understand sticky bits and why I should use them based on my question: What is the "t" letter in the output of "ls -ld /tmp"?
Now I have a new question.
How could I list all files that have stickybits in my Ubuntu Linux?
I now understand sticky bits and why I should use them based on my question: What is the "t" letter in the output of "ls -ld /tmp"?
Now I have a new question.
How could I list all files that have stickybits in my Ubuntu Linux?
This command should serve you (-perm
flag used to be +1000
)
find / -perm /1000
Details:
To add a stickybit Numerical/octal way you have to add "1" to the beginning of the directory.
example:
chmod 1757 ~/Desktop/test
so know to search for a stickybit you have to search for all files having "this one" which means having permissions +1000 (1 here goes for stickybit and "000" for whatever the initial permissions are)
So this command will search the whole filesystem for every file that have permission "+1000".
Now if you have test this command then you can notice that many errors raise here which make the output unclear, and this errors happen because you are trying to search in some places and you don't have a read access on it.
So to get rid of these errors you can redirect those errors to /dev/null
find / -perm +1000 2> /dev/null
Moreover you can redirect the output to a file"output.txt" rather than keep output in the "terminal stdout"
find / -perm +1000 >output.txt 2>/dev/null