Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

In Linux/Unix, if I am inside a directory of another user, but cannot view the contents of the directory by typing "ls," how do I get a copy of all the files?
Is the only way to guess what the file names are?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

In Linux/Unix, a directory is itself a kind of file that can only be modified by special system calls. Like any other file, access to it is controlled by file permissions.

Looking at it in terms of actually implementation, your question boils down to "how do I read a directory file I can't read?" I'm not making fun of your question — I'm just trying to explain why the answer is a definitive "no".

share|improve this answer
    
I suppose it's indeed silly, but it's nice to know for sure! thanks –  Trevor Hickey Nov 27 '12 at 5:07
    
The way you asked the question is not silly. The way I rephrased your question makes it look silly, but I did that to make the logic clear. –  Isaac Rabinovitch Nov 27 '12 at 8:11

You need to have super-user priviledges (a.k.a sudo) to do that.

sudo ls /home/Peter/

(if you want to view Peter's files)

share|improve this answer

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.