Linux.com

Permissions issue.

Link to this post 02 Nov 11

I will gladly give you that infromation. You can pipe the output of any file through grep to limit the output to only the lines that contain your chosen text.

So in my example I want to see all applications that are using the file /usr/lib/libXrender.so.1.3.0

matt:~$lsof|grep "/usr/lib/libXrender.so.1.3.0"
dzen2 2519 matt mem REG 8,5 30712 2532691 /usr/lib/libXrender.so.1.3.0
chrome 2692 matt mem REG 8,5 30712 2532691 /usr/lib/libXrender.so.1.3.0
chrome 2700 matt mem REG 8,5 30712 2532691 /usr/lib/libXrender.so.1.3.0
chrome 2901 matt mem REG 8,5 30712 2532691 /usr/lib/libXrender.so.1.3.0
chrome 2913 matt mem REG 8,5 30712 2532691 /usr/lib/libXrender.so.1.3.0
GoogleTal 2916 matt mem REG 8,5 30712 2532691 /usr/lib/libXrender.so.1.3.0
konsole 3207 matt mem REG 8,5 30712 2532691 /usr/lib/libXrender.so.1.3.0
blender 3666 matt mem REG 8,5 30712 2532691 /usr/lib/libXrender.so.1.3.0
kdeinit4 3908 matt mem REG 8,5 30712 2532691 /usr/lib/libXrender.so.1.3.0
klauncher 3910 matt mem REG 8,5 30712 2532691 /usr/lib/libXrender.so.1.3.0
kded4 3913 matt mem REG 8,5 30712 2532691 /usr/lib/libXrender.so.1.3.0
knotify4 3924 matt mem REG 8,5 30712 2532691 /usr/lib/libXrender.so.1.3.0

This is listing the applications in the first column, the username in use in the third column and the file being used in the last column. If you want to learn more about the uses of lsof or grep you can consult their man pages by typing man followed by the application name.

Link to this post 02 Nov 11

Again, thank you for your kind attention Sir.
I run these commands but couldn´t obtain the user with permission over this files.
I run:

lsof | grep "/maildir/domain.com/user/.Sent/cur/mail_id"

lsof "/maildir/domain.com/user/.Sent/cur/mail_id" (THIS LINE WITHOUT THE GREP FILTER)

lsof | grep /maildir/domain.com/user/.Sent/cur/mail_id (THIS LINE WIYHOUT QUOTES)

lsof /maildir/domain.com/user/.Sent/cur/mail_id (THIS LINE WITHOUT THE GREP FILTER AND WITHOU QUOTES)

But dont´t tell me anything about the user who is owning this file, although I´m logged as root in the system.
Thanks for your patience and your help Sir.


Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board