Change the group name

Hi,

I need to change the group name which is listed under a file.
The file has a list of users that need to be changed under the /home/
I tried with the below, I am sure that its wrong.

ll -la | awk '{ print $4}' | xargs chgrp /root/user

Fundamentals time.

We assume that you are trying to change the group of files.
If this assumption is correct.

The syntax of the command is:

chgrp newgroup filename

Where "chgrp" is the command. See "man chgrp".
Where "newgrp" is the new group name for the "filename".
Where "filename" is the name of the file.

I am stuck.
What exactly is the contents of the "file" ? We can deduce that it contains a list of unix usernames with matching new group name. But what is the exact format of "file"?

Note: The output from:

ll -la | awk '{ print $4}'

is a list of group names. Because this list does not mention the filename the xargs comand is doomed to failure.

Please post the contents of the file called "file" and state the criteria for changing the group of files.

Please check with the below post

Its the same problem as of mine.