Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check permissions of a specific directory?

Tags:

directory

unix

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?

like image 611
user42228 Avatar asked Dec 03 '08 17:12

user42228


People also ask

How do I check folder permissions in CMD?

Or to get the info of all files and folder inside that directory: PS C:\Users\Username> Dir | Get-Acl Directory: C:\Users\Username Path Owner Access ---- ----- ------ . anaconda Owner Name NT AUTHORITY\SYSTEM Allow FullControl... . android Owner Name NT AUTHORITY\SYSTEM Allow FullControl... .

How do I check permissions for a folder for a single user?

To view effective permissions on files and foldersRight-click the file or folder, click Properties, and then click the Security tab. Click Advanced, click the Effective Permissions tab, and then click Select. In Enter the object name to select (examples), enter the name of a user or group, and then click OK.

How do I get permission from specific files?

The -perm parameter of the find command can be used to find the files with specific permissions. The 2 ways to specify the permissions with the -perm parameter are : -perm -mode --- All of the permission bits mode are set for the file. -perm /mode --- Any of the permission bits mode are set for the file.


2 Answers

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

like image 165
Johannes Schaub - litb Avatar answered Sep 21 '22 09:09

Johannes Schaub - litb


You can also use the stat command if you want detailed information on a file/directory. (I precise this as you say you are learning ^^)

like image 42
Piotr Lesnicki Avatar answered Sep 21 '22 09:09

Piotr Lesnicki