how to change group ownership in Linux? [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I have a question about changing group ownership when I did a long listing of a username home root ls -ld ~ and the output came something like this drwx------. 6 prince prince and I was wondering if I have a group called music, how would I change group ownership to music? so the result would something like this prince music.

As a first step, you should first find out the available group names by running the command groups
Considering a case where "music" is one of the available groups, you can change ownership of root recursively by executing the following command:
sudo chown -R prince:music ~

You could change ownership of the folder using chown
sudo chown -R username:group directory
In your case, it would be using
sudo chown -R prince:music directory

Related

Trying to move a file from Documents directory into /etc/bind Linux Ubuntu [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
I want to move/copy a file from the Documents directory into /etc/bind I tried:
sudo mv ~/Documents/Config_Files/db.example.lan /path/to/etc/bind/
I also tried:
sudo mv ~/Documents/Config_Files/db.example.lan /path/to/~//etc/bind/
But also got the error: "No such file or directory"
I am probably being dumb but I double checked spelling capitilisation and everything is correct but still won't come up as a directory.
I can't guide you much but, as you can see we use 'sudo mv' and this means we tell root to move it and you type '~' which means home directory...
So if you type:
sudo mv ~/Documents
this means
sudo mv /root/Documents
instead of
sudo mv /home/<xyz>/Documents
Try to give proper path and let me know if it works.!
example:
sudo mv /home/<username>/Documents/Config_Files/db.example.lan /etc/bind/

Transferring file using SCP command fails with relative path and works with absolute path [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
This is failing. (the file.txt is in the same folder)
sudo scp file.txt shahid#11.34.45.23:~/
#gives error Permission denied (publickey).
The following works, however, it asks for the local machine password
sudo scp me#localhost:/home/file.xt shahid#11.34.45.23:~/
If the file.txt doesn't contain any critical data, change its permissions to allow reading by others:
$ sudo chmod 744 file.txt
And then try the scp.

How do you add a new directory in Linux? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
I am currently taking a Computing GCSE, and I have got a Linux Controlled Assessment, and this is one of the tasks:
Create a directory within your home directory. Name it A452. Navigate to your new A452 directory. Type touch mynametextfile, where myname is your
first name.
I tried adding a new folder called A452, and then opening the terminal and typing touch matthewtextfile, but that didn't work. I am very new to Linux, and I tried Wikipedia, so what should I do?
Edit: It turns out that it was in my Home folder, not my newly created one!
try this in your terminal:
$ cd ~ # move to your home directory
$ mkdir A452 # create directory named A452
$ cd A452 # mv to that directory
$ touch mynametextfile # create file "mynametextfile"

How to delete a file whose owner is set to 777 by mistake on linux [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
Tried with a few things I could think of without success. Ideas? Thanks.
You should be able to delete the file if you run the remove command with sudo
sudo rm /path/to/file.txt
thanks to everyone. The answer is when all attempts to change owner of the file fail, check the owner of its parent directory :).
If it's your server, you can just sudo rm file.
rm -rf filename if you have the permission do delete the file
Otherwise:
sudo chown user filename && rm -rf filename where user is your username.

Group access to a particular directory [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I have a group called optaccess..Now, I need to give access to a directory /opt/sw/vam for this group - optaccess.
How can I do that in Linux?
I tried this
sudo chmod g+rwx *.*
but that does not work?
Where do I specify the group name - optaccess?
You need to run chgrp command. Try
chgrp -R optaccess /opt/sw/vam
Note: Add "-R" only , if you want to change group of all files + subdirectories.
chgrp: This command is used to change group of any directory.
chmod: This command is used to provide: read, write, access to any user/group.
chown: This command is used to change user and/or group of any directory.
For ex:
chown -R foo:optaccess /opt/sw/vam

Resources