Questions tagged [chgrp]

chgrp is Change Group UNIX command.

The chgrp (from change group) command may be used by unprivileged users on Unix-like systems to change the group associated with a file system object (such as a file, directory, or link) to one of which they are a member. A file system object has 3 sets of access permissions, one set for the owner, one set for the group and one set for others. Changing the group of an object could be used to change which users can write to a file.

Syntax

chgrp [options] group FSO

Where:

  • The group parameter specifies the new group with which the files or directories should be associated. It may either be a symbolic name or an identifier.
  • The FSO specifies one or more file system objects, which may be the result of an expression like *.conf

Options:

  • -R recurse through subdirectories;
  • -v verbosely output names of objects changed. Most useful when "FSO" is a list;
  • -f force or forge ahead with other objects even if an error is encountered.
28 questions
7
votes
3 answers

Node.JS: Alternative to chown string

At this time, fs.chown requires int values for uid and gid. So, what is the recommended way to get these int values from a UNIX-like system? Should I read /etc/passwd and /etc/group directly? That does not seem like the right way to do it...
700 Software
  • 85,281
  • 83
  • 234
  • 341
4
votes
2 answers

Shell Command that Combines chmod and chgrp

Is there a combine variant for chmod and chgrp that sets both permissions and groups in one single system call for each file?
Nordlöw
  • 11,838
  • 10
  • 52
  • 99
3
votes
1 answer

Apache/CentOS 7: /var/www/html/ owned by root but created files owned by apache - how do I resolve this?

I have a fresh, unmodified install of Apache on CentOS 7. I notice that when I look at the folder permissions for /var/www/html it and it's content is owned by apache. When a file is created, however, its owner and group is Apache. Though html is…
tylersDisplayName
  • 1,603
  • 4
  • 24
  • 42
3
votes
6 answers

UNIX How to copy entire directory (subdirectories and files) from one location to another and retain permissions

I just copied an entire directory structure from one location on my server to another: cp -r /home/abc/public_html/* /home/xyz/public_html/ That worked fine. Except the dirs & files are now owned by root and the group is root as well. How do I…
H. Ferrence
  • 7,906
  • 31
  • 98
  • 161
2
votes
1 answer

What are file groups (changed using chgrp()) in PHP?

I searched for this information on Google but couldn't find anything detailed. I was reading about the chgrp() and it mentioned that this function can change file group. There is no explanation about what a file group is. I also tried to run the…
Vineet Sharma
  • 221
  • 2
  • 11
2
votes
1 answer

Correct permissions for Tomcat installation on CentOS

I'm setting up Tomcat on Centos according to https://www.digitalocean.com/community/tutorials/how-to-install-apache-tomcat-8-on-centos-7 , but with a twist: I put Tomcat in /opt/apache-tomcat-8.5.6 and then set up a symbolic link: sudo ln -s…
Garret Wilson
  • 18,219
  • 30
  • 144
  • 272
1
vote
1 answer

How to change the php upload with owner group and user

I met a php issue when uploading folder or files on the xampp's apache of ubuntu server: I created a specify FTP group and user with the folder: Group:User = ABC:abc_user the root folder of the group = /htdocs/ABC/uploads Put the program to the…
Oliver Guo
  • 166
  • 9
1
vote
0 answers

Allow PHP chown, chgrp and chmod of specific files & directories with specific user & group

I have a directory called /folder1/folder2/folder3 where our program resides; the program houses a php gui, python CLI tools and lots of big files. The big files are uploaded via the gui and processed by the python scripts (which includes coping or…
gunslingor
  • 1,358
  • 12
  • 34
1
vote
1 answer

Chef - Change files group recursively

I have the following structure: /opt/conf/files.txt What I'm trying to achieve is: sudo chgrp -R tomcat conf Change all the files in the 'conf' directory to the group 'tomcat' I tried this: directory "/opt/conf" do group 'tomcat' mode '0070' …
Libert
  • 172
  • 2
  • 12
1
vote
1 answer

Homebrew user, group, permissions for admin - how to script chown, chgrp, chmod?

Homebrew brew doctor is printing many permissions errors, on a system that has multiple users. Some of the users are fully trusted, and need to be able to run typical brew commands such as brew install and brew update. Some stackoverflow posts are…
joelparkerhenderson
  • 34,808
  • 19
  • 98
  • 119
1
vote
1 answer

chgrp: apache illegal group name error in Mac OS X

I'm running chgrp apache session command to make sure that my php session directory has apache write permissions but I am getting the error: chgrp: apache illegal group name. I am following a set of instructions for this. The next step says to…
covfefe
  • 2,485
  • 8
  • 47
  • 77
1
vote
2 answers

Unix shell: Recursive find to chgrp on all files and dirs EXCEPT a single named dir

I see a few requests that are similar to mine using the prune action, but what I want to do is recursively navigate through a docroot: /opt/web which contains several files and directories: /opt/web/foo.html (file) /opt/web/bar.txt …
1
vote
1 answer

Change default user of folder

I'm having a little problem here. So I changed the group of a folder including subfolders via chgrp -R groupname and it works all fine but I'm using transmission and pyload to download files into those folders and they both write the files as root…
tamani
  • 11
  • 3
1
vote
1 answer

CRON chown and chgrp to a directory from root user

I am trying to change group and owner (from root to www-data)for a directory at each 5 min interval. So I have set a cron on root user like ` 0,5 * * * * sudo /bin/chown -R www-data /var/www/pdf/ && sudo /bin/chgrp -R www-data /var/www/pdf/ But…
Sam
  • 1,033
  • 3
  • 16
  • 25
1
vote
2 answers

Set group of directory to name of directory

I have a bunch of folders I would like to find and change the group to the directory name. /SchoolA/ /SchoolB/ ...... /SchoolZZZ/ I can't figure it out - but would like something like: find . -type d -exec chgrp {} {} \; I get illegal group name…
broccolifarmer
  • 465
  • 7
  • 15
1
2