Sunday, January 5, 2014

Recursively checking the permissions of a file/directory tree using - namei command

There are situations when you want to troubleshoot the permissions issue on a file buried under multiple directory levels. You would want a simple mechanism to check the permissions of the file in question and all of its parent directories as well. Well -- namei -- does just that. 


bash# namei -l /var/tmp/dir1/dir2/file
f: /var/tmp/dir1/dir2/file
drwxr-xr-x root root /
drwxr-xr-x root root var
drwxrwxrwt root root tmp
drwxr-xr-x root root dir1
drwxr-xr-x root root dir2
-rw-r--r-- root root file



-l stands for long listing.


--

No comments:

Post a Comment