How to use wilcards on chown command?
I need to use wildcards on chown command. Example:
# chown app:demo /opt/app/users/*/demo
I get the following error:
chown: can not access "/opt/app/users/*/demo" ': No such file or directory
But does not work. What can I do?
bash chown
add a comment |
I need to use wildcards on chown command. Example:
# chown app:demo /opt/app/users/*/demo
I get the following error:
chown: can not access "/opt/app/users/*/demo" ': No such file or directory
But does not work. What can I do?
bash chown
Have you permission? Maybe you nedd to usesudo
– jcbermu
Mar 15 '16 at 14:14
use centos 6 and root user.
– e-info128
Mar 15 '16 at 14:16
2
Remove the double quotes on the directory pathchown storage:storage_clientes_bitac -R /home/storage/storage/Empresa/*/Bitacoras
– jcbermu
Mar 15 '16 at 14:16
add a comment |
I need to use wildcards on chown command. Example:
# chown app:demo /opt/app/users/*/demo
I get the following error:
chown: can not access "/opt/app/users/*/demo" ': No such file or directory
But does not work. What can I do?
bash chown
I need to use wildcards on chown command. Example:
# chown app:demo /opt/app/users/*/demo
I get the following error:
chown: can not access "/opt/app/users/*/demo" ': No such file or directory
But does not work. What can I do?
bash chown
bash chown
edited Feb 18 at 15:32
Henders
10326
10326
asked Mar 15 '16 at 13:51
e-info128e-info128
1066
1066
Have you permission? Maybe you nedd to usesudo
– jcbermu
Mar 15 '16 at 14:14
use centos 6 and root user.
– e-info128
Mar 15 '16 at 14:16
2
Remove the double quotes on the directory pathchown storage:storage_clientes_bitac -R /home/storage/storage/Empresa/*/Bitacoras
– jcbermu
Mar 15 '16 at 14:16
add a comment |
Have you permission? Maybe you nedd to usesudo
– jcbermu
Mar 15 '16 at 14:14
use centos 6 and root user.
– e-info128
Mar 15 '16 at 14:16
2
Remove the double quotes on the directory pathchown storage:storage_clientes_bitac -R /home/storage/storage/Empresa/*/Bitacoras
– jcbermu
Mar 15 '16 at 14:16
Have you permission? Maybe you nedd to use
sudo– jcbermu
Mar 15 '16 at 14:14
Have you permission? Maybe you nedd to use
sudo– jcbermu
Mar 15 '16 at 14:14
use centos 6 and root user.
– e-info128
Mar 15 '16 at 14:16
use centos 6 and root user.
– e-info128
Mar 15 '16 at 14:16
2
2
Remove the double quotes on the directory path
chown storage:storage_clientes_bitac -R /home/storage/storage/Empresa/*/Bitacoras– jcbermu
Mar 15 '16 at 14:16
Remove the double quotes on the directory path
chown storage:storage_clientes_bitac -R /home/storage/storage/Empresa/*/Bitacoras– jcbermu
Mar 15 '16 at 14:16
add a comment |
2 Answers
2
active
oldest
votes
You have enclosed your pattern in "double quotes", which prevent filename expansion (also called globbing):
Double quotes: "..." prevents some substitutions but allows others. Every substitution that begins with a dollar sign $ is performed, as is the legacy
...(backtick) command substitution. Backslash escaping is also performed. No word splitting or filename expansion is performed.
The solution is obviously to run your command without the quotes, like jcbermu pointed out:
chown storage:storage_clientes_bitac -R /home/storage/storage/Empresa/*/Bitacoras
One important thing you should remember is to post commands and error messages verbatim when asking questions. Not everyone here likes guessing games.
add a comment |
Wildcards are often problematic when not in the basename
You could do this
find /opt/app/users/ -name demo -exec chown app:demo {} ;
need /opt/app/users/*/demo/ but no /opt/app/users/*/demo2/demo
– e-info128
Mar 15 '16 at 14:24
Oh, just one layer deep? tryfind /opt/app/users/ -maxdepth 1 -type d -name demo -exec echo {} found;to see if that works. If it finds the right directories, change the echo into a chown command
– infixed
Mar 15 '16 at 14:35
I'm not where I can try it. Maybe it's-maxdepth 2you need.
– infixed
Mar 15 '16 at 14:42
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1053124%2fhow-to-use-wilcards-on-chown-command%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You have enclosed your pattern in "double quotes", which prevent filename expansion (also called globbing):
Double quotes: "..." prevents some substitutions but allows others. Every substitution that begins with a dollar sign $ is performed, as is the legacy
...(backtick) command substitution. Backslash escaping is also performed. No word splitting or filename expansion is performed.
The solution is obviously to run your command without the quotes, like jcbermu pointed out:
chown storage:storage_clientes_bitac -R /home/storage/storage/Empresa/*/Bitacoras
One important thing you should remember is to post commands and error messages verbatim when asking questions. Not everyone here likes guessing games.
add a comment |
You have enclosed your pattern in "double quotes", which prevent filename expansion (also called globbing):
Double quotes: "..." prevents some substitutions but allows others. Every substitution that begins with a dollar sign $ is performed, as is the legacy
...(backtick) command substitution. Backslash escaping is also performed. No word splitting or filename expansion is performed.
The solution is obviously to run your command without the quotes, like jcbermu pointed out:
chown storage:storage_clientes_bitac -R /home/storage/storage/Empresa/*/Bitacoras
One important thing you should remember is to post commands and error messages verbatim when asking questions. Not everyone here likes guessing games.
add a comment |
You have enclosed your pattern in "double quotes", which prevent filename expansion (also called globbing):
Double quotes: "..." prevents some substitutions but allows others. Every substitution that begins with a dollar sign $ is performed, as is the legacy
...(backtick) command substitution. Backslash escaping is also performed. No word splitting or filename expansion is performed.
The solution is obviously to run your command without the quotes, like jcbermu pointed out:
chown storage:storage_clientes_bitac -R /home/storage/storage/Empresa/*/Bitacoras
One important thing you should remember is to post commands and error messages verbatim when asking questions. Not everyone here likes guessing games.
You have enclosed your pattern in "double quotes", which prevent filename expansion (also called globbing):
Double quotes: "..." prevents some substitutions but allows others. Every substitution that begins with a dollar sign $ is performed, as is the legacy
...(backtick) command substitution. Backslash escaping is also performed. No word splitting or filename expansion is performed.
The solution is obviously to run your command without the quotes, like jcbermu pointed out:
chown storage:storage_clientes_bitac -R /home/storage/storage/Empresa/*/Bitacoras
One important thing you should remember is to post commands and error messages verbatim when asking questions. Not everyone here likes guessing games.
answered Mar 21 '16 at 16:48
Dmitry GrigoryevDmitry Grigoryev
5,92212259
5,92212259
add a comment |
add a comment |
Wildcards are often problematic when not in the basename
You could do this
find /opt/app/users/ -name demo -exec chown app:demo {} ;
need /opt/app/users/*/demo/ but no /opt/app/users/*/demo2/demo
– e-info128
Mar 15 '16 at 14:24
Oh, just one layer deep? tryfind /opt/app/users/ -maxdepth 1 -type d -name demo -exec echo {} found;to see if that works. If it finds the right directories, change the echo into a chown command
– infixed
Mar 15 '16 at 14:35
I'm not where I can try it. Maybe it's-maxdepth 2you need.
– infixed
Mar 15 '16 at 14:42
add a comment |
Wildcards are often problematic when not in the basename
You could do this
find /opt/app/users/ -name demo -exec chown app:demo {} ;
need /opt/app/users/*/demo/ but no /opt/app/users/*/demo2/demo
– e-info128
Mar 15 '16 at 14:24
Oh, just one layer deep? tryfind /opt/app/users/ -maxdepth 1 -type d -name demo -exec echo {} found;to see if that works. If it finds the right directories, change the echo into a chown command
– infixed
Mar 15 '16 at 14:35
I'm not where I can try it. Maybe it's-maxdepth 2you need.
– infixed
Mar 15 '16 at 14:42
add a comment |
Wildcards are often problematic when not in the basename
You could do this
find /opt/app/users/ -name demo -exec chown app:demo {} ;
Wildcards are often problematic when not in the basename
You could do this
find /opt/app/users/ -name demo -exec chown app:demo {} ;
answered Mar 15 '16 at 14:16
infixedinfixed
72949
72949
need /opt/app/users/*/demo/ but no /opt/app/users/*/demo2/demo
– e-info128
Mar 15 '16 at 14:24
Oh, just one layer deep? tryfind /opt/app/users/ -maxdepth 1 -type d -name demo -exec echo {} found;to see if that works. If it finds the right directories, change the echo into a chown command
– infixed
Mar 15 '16 at 14:35
I'm not where I can try it. Maybe it's-maxdepth 2you need.
– infixed
Mar 15 '16 at 14:42
add a comment |
need /opt/app/users/*/demo/ but no /opt/app/users/*/demo2/demo
– e-info128
Mar 15 '16 at 14:24
Oh, just one layer deep? tryfind /opt/app/users/ -maxdepth 1 -type d -name demo -exec echo {} found;to see if that works. If it finds the right directories, change the echo into a chown command
– infixed
Mar 15 '16 at 14:35
I'm not where I can try it. Maybe it's-maxdepth 2you need.
– infixed
Mar 15 '16 at 14:42
need /opt/app/users/*/demo/ but no /opt/app/users/*/demo2/demo
– e-info128
Mar 15 '16 at 14:24
need /opt/app/users/*/demo/ but no /opt/app/users/*/demo2/demo
– e-info128
Mar 15 '16 at 14:24
Oh, just one layer deep? try
find /opt/app/users/ -maxdepth 1 -type d -name demo -exec echo {} found; to see if that works. If it finds the right directories, change the echo into a chown command– infixed
Mar 15 '16 at 14:35
Oh, just one layer deep? try
find /opt/app/users/ -maxdepth 1 -type d -name demo -exec echo {} found; to see if that works. If it finds the right directories, change the echo into a chown command– infixed
Mar 15 '16 at 14:35
I'm not where I can try it. Maybe it's
-maxdepth 2 you need.– infixed
Mar 15 '16 at 14:42
I'm not where I can try it. Maybe it's
-maxdepth 2 you need.– infixed
Mar 15 '16 at 14:42
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1053124%2fhow-to-use-wilcards-on-chown-command%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Have you permission? Maybe you nedd to use
sudo– jcbermu
Mar 15 '16 at 14:14
use centos 6 and root user.
– e-info128
Mar 15 '16 at 14:16
2
Remove the double quotes on the directory path
chown storage:storage_clientes_bitac -R /home/storage/storage/Empresa/*/Bitacoras– jcbermu
Mar 15 '16 at 14:16