Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know to change an owner you put

chown user:group file 

but what if I want to see who owns a file?

The issue I am having is I created a user at /var/www/new-user but when he uploads new files to there, they can't be viewed. I think I have to change the owner or group to www-data. Not positive.

I already have a user at /var/www/john that works fine. I thought I set the new on up the same. I wanted to compare mine and see whats different.

share|improve this question
up vote 11 down vote accepted

If you do ls -lh file you will see who owns it and what the permissions are. You could do ls -lh /var/www/ and compare the results between /var/www/john and /var/www/new-user.

share|improve this answer

To see the files ownership try ls -l

ls -l file
-rw-r--r-- 1 iain users 0 May  5 12:46 file
share|improve this answer

LS is probably the tool you want, but just to provide some additional variety. You could use

stat filename

share|improve this answer

Your Answer


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.