工作中经常要查看目录、文件权限问题,如果主目录下要查看各级权限,就很繁琐
但是可以用namei工具实现,如下:
# namei -m /usr/local/apache2/htdocs/index.html
f: /usr/local/apache2/htdocs/index.html
dr-xr-xr-x /
drwxr-xr-x usr
drwxr-xr-x local
drwxr-xr-x apache2
drwxr-xr-x htdocs
-rw-r--r-- index.html
查看所有者
# namei -o /usr/local/apache2/htdocs/index.html
f: /usr/local/apache2/htdocs/index.html
d root root /
d root root usr
d root root local
d root root apache2
d root root htdocs
- root root index.html