N
Niwrad
Guest
Is there a shell script or command that will list out the permissions for every directory from a file's path?
e.g: If we wanted to run the script on ~/dir1/dir2/dir3/file, the desirable output would be something like:
drwxrwxr-t 333 root admin 333 Jun 3 13:33 Users
drwxr-xr-x 33 $shortname $shortname 333 Jun 3 13:33 $shortname
drwxr-xr-x 3 $shortname $shortname 333 May 3 13:33 dir1
drwxr-xr-x 3 $shortname $shortname 333 May 3 13:33 dir2
drwxr-xr-x 3 $shortname $shortname 333 May 3 13:33 dir3
-rwxr-xr-x 3 $shortname $shortname 333 May 3 13:33 file
e.g: If we wanted to run the script on ~/dir1/dir2/dir3/file, the desirable output would be something like:
drwxrwxr-t 333 root admin 333 Jun 3 13:33 Users
drwxr-xr-x 33 $shortname $shortname 333 Jun 3 13:33 $shortname
drwxr-xr-x 3 $shortname $shortname 333 May 3 13:33 dir1
drwxr-xr-x 3 $shortname $shortname 333 May 3 13:33 dir2
drwxr-xr-x 3 $shortname $shortname 333 May 3 13:33 dir3
-rwxr-xr-x 3 $shortname $shortname 333 May 3 13:33 file