Search code examples
unixls

What command should I use to display specific information about a directory, not its content?


I need to know how to display info about a directory itself.

I have tried using ls -l on the directory where the directory I wanted to know about was in, but had no luck.


Solution

  • Use this command (The -d flag will make ls display only directories):

    ls -ld directoryname
    

    If you are looking for more detailed info, you can use the stat command (more info on stat):

    stat directoryname
    

    Here is an example of what stat will return:

    enter image description here