Академический Документы
Профессиональный Документы
Культура Документы
ne t
T he f irst thing you might want to do is list the content of the current directory. If youre a new user, run the ls command. ls
To change the ownership of a single f ile, run the command below. sudo chown <username>:<groupname> lename
Replace <username> with the username of the account you wish to take ownership of the f ile. And <groupname> is the group that will assume ownership of the f ile.
By def ault, when a new account is created in Linux, a group is also created named af ter the username of the account. For example, if a user account is created with username <pumpkin>, a group will automatically be created named <pumpkin> and the user is automatically made a member of that group.
So, if you run the commands below, youre giving ownership to the user <pumpkin> and the <pumpkin> group. sudo chown pumpkin:pumpkin le.t xt
But wait, you dont always need to specif y a group everytime you wish to change the ownership of a f ile. You could just change the username f or a particular f ile and the group can stay intact. sudo chown <username> <lename.t xt >
Now that you know how to change the ownership of a single f ile, the below commands show you how to change the ownership of a f older and all sub-f olders within. sudo chown -R <username>:<groupname> FolderName