How to check permissions of a specific directory?

user42228 picture user42228 · Dec 3, 2008 · Viewed 733.3k times · Source

I know that using ls -l "directory/directory/filename" tells me the permissions of a file. How do I do the same on a directory?

I could obviously use ls -l on the directory higher in the hierarchy and then just scroll till I find it but it's such a pain. If I use ls -l on the actual directory, it gives the permissions/information of the files inside of it, and not of the actual directory.

I tried this in the terminal of both Mac OS X 10.5 and Linux (Ubuntu Gutsy Gibbon), and it's the same result. Is there some sort of flag I should be using?

Answer

Johannes Schaub - litb picture Johannes Schaub - litb · Dec 3, 2008

Here is the short answer:

$ ls -ld directory

Here's what it does:

-d, --directory
    list directory entries instead of contents, and do not dereference symbolic links

You might be interested in manpages. That's where all people in here get their nice answers from.

refer to online man pages