Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Is there a way to check the permissions of the root folder, /? I mean the folder's permissions, not its content's (/var, /usr, etc.) permissions? Running ls /.. shows the content's permissions.

share|improve this question
    
Have you tried the -l option: ls -l / –  sgmart 2 days ago
1  
Yes, it shows the contents; I wanted the contents of the outer folder, which doesn't technically exist. The question is already answered anyway. –  trysis 2 days ago
add comment

3 Answers

up vote 48 down vote accepted

You can also use the -d switch of ls:

$ ls -ld /
drwxr-xr-x 28 root root 126976 Mar 20 17:11 /

From man ls:

   -l     use a long listing format
   -d, --directory
          list  directory entries instead of contents, and do not derefer‐
          ence symbolic links
share|improve this answer
    
Beat me to it, +1 ;) –  psusi 2 days ago
add comment

stat -c "%a %n" /

It will give you the permissions.

share|improve this answer
1  
Thanks, that was fast. stat seems like an interesting, useful command, having read its man page. –  trysis 2 days ago
    
You should use the a switch to see the permissions of . which corresponds to root home. –  Ramesh 2 days ago
    
Yeah, that's what the other answer says, and what I should have thought of. D'oh! –  trysis 2 days ago
    
ha ha. You can accept either of the 2 answers. Both the answers seem to suit what you need :) –  Ramesh 2 days ago
    
Ugh, I wish I could accept both. They're both perfect! –  trysis 2 days ago
show 1 more comment

Use the -a switch of ls to include hidden files as well as . and .. in the listing and the -l switch for a "long" listing (which includes the permissions, among other information):

ls -la /

The first line (.) will contain the information about / itself:

drwxr-xr-x 26 root root 4096 Mar 10 15:57 .

share|improve this answer
1  
@trysis I routinely use ls -blah. It has everything you could possibly want to know about a file or directory. –  n.st 2 days ago
2  
This is not really a very good solution, it will list all files under / when all the OP wanted was / itself. See stat or ls -ld in the answers below. –  terdon 2 days ago
1  
@trysis You might want to accept terdon's answer instead since it's closer to what you originally wanted to achieve. –  n.st 2 days ago
1  
Fair enough, the comment was not so much directed at you as to future users who might see this as the accepted answer and assume it is the Best Way® to do it. –  terdon 2 days ago
2  
. is not necessarily first. The list is sorted lexically. There are several characters that sort before . in many locales. –  Stephane Chazelas 2 days ago
show 5 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.