Questions tagged [chown]

All about changing ownership of files.

The chown command can be used to change the ownership of files and directories. Changing file ownership requires superuser privileges, or at least the CAP_CHOWN capability (see ).

There is also the chgrp commant to chang the group ownership of files. However, on Linux and most modern Unix systems chown can be used to change file ownership, group ownership, or both.

Use this tag if you question is related to changing ownership of files.

Note: the tags or probably apply as well or are even more appropriate.

External reference

chown specification (The Open Group Base Specifications Issue 7, 2018 edition)

284 questions
48
votes
2 answers

Is it possible to chown a file, based on numeric UID, to a user that does not yet exist?

For example, for managing a disk partition for another system where the user exists. I know I can simply create a user temporarily but I find this question interesting.
glarry
  • 914
  • 1
  • 7
  • 16
31
votes
2 answers

What is the equivalent for 'www-data' for CentOs?

CentOs doesn't recognise www-data but want to change ownership on my files folder. All my folders are owned by root at the moment. Confused as to what should be owned by apache and what she be owned by me the root user? Also when it says root root…
freja
  • 697
22
votes
2 answers

What is the point of chgrp?

I know what chgrp and chown do. My question is since chown does the same thing as chgrp (and even more), what is the point of chgrp?
11
votes
1 answer

chown only where needed / speedup chown

On a folder with millions of files this can take quite a long time: chown someuser -Rf /folder_with_lots_of_files/ How can I speed this up if 99.9% of those files already belong to someuser?
rubo77
  • 28,966
7
votes
2 answers

What does `chown root.root $file` mean?

I'm trying to install colordiff in a custom directory because I do not have sudo privileges. I did make the directories hard-coded in the Makefile as stated in the README, but I'm getting this error: ... chown root.root…
RSFalcon7
  • 4,407
3
votes
2 answers

Can one change the user of a file when controlling both user accounts?

I am controlling two user accounts on a machine where I am not root. Is it possible to "give away" some files from one account to another? Rationale: I setup a bare git repo on the machine as the origin repo. Now, I want to have the files in that…
Rolf
  • 902
2
votes
2 answers

How to conditionlly change ownership of a file?

I was tasked to change the owner of a file called hello to vincent only if the owner was guillame. I tried to use chmod vincent:guillame hello but this is not working. Please, I need help to solve the task.
2
votes
2 answers

Can someone explain what this chown is actually doing?

Can someone in detail explain what exactly the following command that a tutorial has instructed me to issue is doing? chown -R $USER:$GROUP
2
votes
1 answer

Accidentally chown'd everything

So I have a bit of an issue. I accidentally chown'd everything to my user, recursively. sudo chown -R me:me /* I meant to only do this to one directory which I thought I was in. I cancelled it very quickly (3 seconds?) and I'm not sure how much…
CT16
  • 21
2
votes
2 answers

what is the difference in ownership order?

What is the difference on CentOS Linux if you chown apache:root or root:apache? I am trying to set correct ownership for Drupal install but both Drupal Docs and all subsequent pages of discussions following have varying ideas on the subject and…
cea
  • 1,543
0
votes
0 answers

Chown accident, everything owned by user "bunchy7s"

Wanted to do chown -r bunchy7s /var/lib/jellyfin, I however forgot the var/lib/jellyfin part. now everything is owned by bunchy7s! :) and nothing works how you would expect! Yay!
0
votes
2 answers

I run a wrong "chown -R /" command. Anything I can do to undo or minimize the impact?

i wanted to change the ownership of one specific folder and I think I messed it up. I run following command: sudo chown -R ubuntu / (I was thinking it will only change the folder I was located in) The last output lines were: chown: changing…
jjx
  • 9
0
votes
1 answer

Why is there a chgrp command if there is chown

After working 15 years with Linux, I stumbled upon the command chgrp. Until now, I always used chown to change the ownership of a file, even if I only changed the group; for example chown :www-data index.php So I wonder if there is anything that…
rexkogitans
  • 1,329
0
votes
3 answers

How to change the user name without using root access?

Here is my access location: drwxrwsr-x 10 dara nm 4096 Jul 24 11:33 16.20 drwxrwsr-x 8 dara nm 4096 Jul 24 11:22 16.22 Here i want to change the user name instead of dara to lara without using root access.How can i do it? Expected…
salma
  • 83
0
votes
1 answer

unable to chown a directory recursiverly "unknown user id"

I trying to chown the directory for changing the permissions of the directory. But it shows some error as unknown user id I tried to chown using the command : chown -R www-data [directory name] it shows the error as unknown user id www-data How to…
GIRI
  • 877
1
2