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
Related
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
There was a directory structure on my linux server like this A/$b/
From my home directory executed a command
rm -rf A/$b.
After executing this command, The directory A itself was deleted.
Any idea what would have happened in the background?
A $ sign indicates the start of a variable in most shell languages.
If $b is not defined then your command would resolve as:
rm -rf A/
… which would delete the A directory.
To include the $ in the path you need to escape it:
rm -rf A/\$B
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/
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.
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
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.