2022 Developer Survey is open! Take survey.

Questions tagged [chgrp]

For questions about resolving errors when attempting to change the group owner of a file.

Filter by
Sorted by
Tagged with
2 votes
1 answer
25 views

modify group for one command

I want to execute one command and I want that it is executed with a specific groupname, that I'm belonging to, but which is not my default group. So all files created will belong to that group. Is ...
user avatar
  • 123
0 votes
0 answers
42 views

How to go through every file and directory on server and change group ownership?

The goal is to loop through every file on the server, check if each file or dir has the 'groupA' group in the permissions. If the 'groupA' group is in the permissions, change it to 'groupB'. Otherwise ...
user avatar
-3 votes
1 answer
41 views

Does chgrp -p exist? [closed]

Does any version of the chgrp command have a -p option? If so, what does the -p option do? I am aware of the -P option. Example usage: chgrp -p folder group where folder is a folder and group a group....
user avatar
  • 107
6 votes
2 answers
799 views

How do I recursively run "chgrp" without changing the group if it matches a specific group?

I just copied all the files/subdirectories in my home directory to another user's home directory. Then I did a recursive chown on his home directory, so that he became the owner of all his files/...
user avatar
1 vote
1 answer
222 views

chmod file permissions under home directory

I am a beginner here at unix administration. When we create a Unix user, we get a home directory for the user. Inside the home directory i.e ~/ for all the files and directories that we create, what ...
user avatar
  • 135
0 votes
1 answer
33 views

is there a preference when using chgrp or chown for named or numeric args

When using chgrp or chown I see zero used quite frequently as the named group or user, instead of root. Is there a preference for either? And in what use case is the numeric arg preferable?
user avatar
0 votes
1 answer
39 views

How is it possible to set a directory permission, so the group can both read and write files in it? (Regardless who created a file)

I created a directory, which is owned by the www-data group. I would like to make the files in it writeable by the members of the group, no matter who created the file. My username is pi. I tried it ...
user avatar
  • 101
0 votes
0 answers
41 views

same NAS, same folder, but different groups showed in two different hosts, why?

I have a strange behaviour with a shared NAS between multiple hosts. Every host reaches a shared folder mounted on /sharedfolder on the same source (##.###.###.###:/filesystem, where ## are the ...
user avatar
2 votes
2 answers
829 views

chgrp chown usermod are useless if not root?

I am logged under 'achille' achille belongs to 2 groups: groups achille achille: achille users I want to change the group owner of file 'tree.test' to group 'users' ls -l tree.test -rw-r--r--. ...
user avatar
  • 69
4 votes
4 answers
3k views

Can't create directory in directory owned by group

I have a group called homeperms on an Ubuntu system, with a few users: $ cat /etc/group | grep "homeperms" homeperms:x:1004:jorik,tim.wijma,vanveenjorik,jorik_c And I've done $ sudo chgrp -R ...
user avatar
  • 145
0 votes
1 answer
7k views

Use AD Groups Instead of Linux Groups

On our file server, we are using a bunch of Linux groups that are still in use and need to be replaced by their counterparts in AD. The groups in AD and /etc/groups have an identical name, so, (I'm ...
user avatar
0 votes
1 answer
32 views

How to operate on a directory with different owner from a script?

Few days ago i have installed elasticsearch, For diagnosing some problems on my elasticsearch setup, i have checked the logs files located in /var/log/elasticsearch and tailed them but apparently the ...
user avatar
0 votes
1 answer
131 views

Mounting a filesystem with gid=501 or chgrp filesystem after mounting

Is there any difference between mounting a filesystem with gid=501 mount option vs chgrp 501 $fs after it's mounted? I want to know if mounting with gid mount option buys me anything that chgrp (as ...
user avatar
0 votes
3 answers
2k views

What "chgrp 0" do?

I am analyzing one script and I cannot find online what chgrp 0 mean in the following line: find $1 -follow -exec chgrp 0 {} so find $1 takes parameter, -follow causes find to follow symlinks, -...
user avatar
0 votes
1 answer
1k views

How to change the owner and group of a directory by the name of that directory?

I have a Ubuntu 16.04 Nginx server environment with several CMS (WordPress) websites under document root. All the site directories have www-data as owner and group, recursively. According to some ...
user avatar
  • 1,460
1 vote
4 answers
177 views

How to securely sanitize permissions for a subtree

On our server, there are multiple (currently two, expected three or four) users allowed to deploy a new version of our application. This process consists of downloading a few files from a trusted ...
user avatar
  • 4,731
17 votes
1 answer
23k views

How to perform chown and chgrp in one command

In order to change both a file's owner and group we can do this: chown trump file chgrp trump file but can I do both commands in one approach or one command?
user avatar
  • 11k
11 votes
4 answers
2k views

Howto prevent chgrp from clearing “setuid bit”?

We have RH based Linux images; on which I have to "apply" some "special archive" in order to upgrade them to the latest development version of our product. The person creating the archive figured ...
user avatar
  • 230
1 vote
1 answer
526 views

Access manpage(2) on OS X

In Mac OS X, at the end of the chmod man page, it shows See also: chmod(2) But when I enter man chmod(2) It says that there is no such man page. How can I access the man page chmod(2) man page? ...
user avatar
1 vote
1 answer
118 views

custom sysconfdir for coreutils

I compiled coreutils with --sysconfdir=/test/etc instead of default /etc, moved /etc/group to /test/etc/group, and chgrp failed with chgrp: invalid group: $groupname. How can I fix that and make ...
user avatar