1

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?

2 Answers 2

3

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".

2
  • I suppose it's indeed silly, but it's nice to know for sure! thanks Nov 27, 2012 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. Nov 27, 2012 at 8:11
1

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)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .