I have a file path.. Is there any single command to see the file/directory permissions of all the intermediate directories in the path..?
相关问题
- How to get the return code of a shell script in lu
- Is shmid returned by shmget() unique across proces
- how to get running process information in java?
- JQ: Select when attribute value exists in a bash a
- Invoking Mirth Connect CLI with Powershell script
I know of one such command, but it is almost 30 years old although it still works fine. It should be rewritten in sh or perl, but this works:
And here is an example of running it:
It default to the cwd. Yes, the output is not pretty. If I get motivated this morning, maybe I’ll rewrite it.
EDIT
Here’s a rewrite that uses your system
ls
program. It has advantages in how it deals with symlinks:But I really hate the way
ls
formats things. For example:See what I mean? So here’s one that’s entirely built-in.
Took me forever to track down the major/minor macros, since the ls routine I stole from
find2perl
. It probably won’t do these right on other systems than the ones I test for.For example:
You can run this code :
Edit: added local keyword
Edit2: The last item error is resolved
Here is a simple while-loop which does the job: