why 'cannot overwrite existing file'?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I try to write to a file "date > file" but Linux says 'cannot overwrite existing file'. I tried chmod 755 but still cannot write to the file. What should I do? Thank you.
linux filesystems
add a comment |
I try to write to a file "date > file" but Linux says 'cannot overwrite existing file'. I tried chmod 755 but still cannot write to the file. What should I do? Thank you.
linux filesystems
add a comment |
I try to write to a file "date > file" but Linux says 'cannot overwrite existing file'. I tried chmod 755 but still cannot write to the file. What should I do? Thank you.
linux filesystems
I try to write to a file "date > file" but Linux says 'cannot overwrite existing file'. I tried chmod 755 but still cannot write to the file. What should I do? Thank you.
linux filesystems
linux filesystems
asked Mar 8 '11 at 2:28
MartinMartin
16417
16417
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
If you are running bash, the noclobber option has been set. Use >| if you want to temporarily override this.
How to redirect both stderr and stdout and temporarily override noclobber at the same time? I tried&>|without luck.
– Tu Bui
Aug 24 '18 at 9:35
add a comment |
It is possible that the file was set as immutable with chattr. It's rarely used, but it's a realistic possibility. In that case:
chattr -i [filename]
... should be able to remove that attribute.
1
Writing to an "immutable" file would result in "Operation not permitted.".
– grawity
Mar 8 '11 at 12:44
add a comment |
- Go to your home folder
- Press Ctrl + H to show hidden files
- Check whether any of the folders are locked
- Right click on the folder then click "properties". In that click "permissions".
- Under owner, change folder access to "create and delete files."
- Click "Apply Permissions to Enclosed files"
If you cannot see any locked folders then select all folders and do the above
2
Somehow, I don't expect this to work in every case ;-) Hint: some people don't use the same DE as you do, or even any GUI at all.
– Psirus
Jan 31 '12 at 14:39
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%2f254644%2fwhy-cannot-overwrite-existing-file%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
If you are running bash, the noclobber option has been set. Use >| if you want to temporarily override this.
How to redirect both stderr and stdout and temporarily override noclobber at the same time? I tried&>|without luck.
– Tu Bui
Aug 24 '18 at 9:35
add a comment |
If you are running bash, the noclobber option has been set. Use >| if you want to temporarily override this.
How to redirect both stderr and stdout and temporarily override noclobber at the same time? I tried&>|without luck.
– Tu Bui
Aug 24 '18 at 9:35
add a comment |
If you are running bash, the noclobber option has been set. Use >| if you want to temporarily override this.
If you are running bash, the noclobber option has been set. Use >| if you want to temporarily override this.
answered Mar 8 '11 at 2:40
Ignacio Vazquez-AbramsIgnacio Vazquez-Abrams
96.8k6155211
96.8k6155211
How to redirect both stderr and stdout and temporarily override noclobber at the same time? I tried&>|without luck.
– Tu Bui
Aug 24 '18 at 9:35
add a comment |
How to redirect both stderr and stdout and temporarily override noclobber at the same time? I tried&>|without luck.
– Tu Bui
Aug 24 '18 at 9:35
How to redirect both stderr and stdout and temporarily override noclobber at the same time? I tried
&>| without luck.– Tu Bui
Aug 24 '18 at 9:35
How to redirect both stderr and stdout and temporarily override noclobber at the same time? I tried
&>| without luck.– Tu Bui
Aug 24 '18 at 9:35
add a comment |
It is possible that the file was set as immutable with chattr. It's rarely used, but it's a realistic possibility. In that case:
chattr -i [filename]
... should be able to remove that attribute.
1
Writing to an "immutable" file would result in "Operation not permitted.".
– grawity
Mar 8 '11 at 12:44
add a comment |
It is possible that the file was set as immutable with chattr. It's rarely used, but it's a realistic possibility. In that case:
chattr -i [filename]
... should be able to remove that attribute.
1
Writing to an "immutable" file would result in "Operation not permitted.".
– grawity
Mar 8 '11 at 12:44
add a comment |
It is possible that the file was set as immutable with chattr. It's rarely used, but it's a realistic possibility. In that case:
chattr -i [filename]
... should be able to remove that attribute.
It is possible that the file was set as immutable with chattr. It's rarely used, but it's a realistic possibility. In that case:
chattr -i [filename]
... should be able to remove that attribute.
answered Mar 8 '11 at 2:51
0xC0000022L0xC0000022L
3,43363867
3,43363867
1
Writing to an "immutable" file would result in "Operation not permitted.".
– grawity
Mar 8 '11 at 12:44
add a comment |
1
Writing to an "immutable" file would result in "Operation not permitted.".
– grawity
Mar 8 '11 at 12:44
1
1
Writing to an "immutable" file would result in "Operation not permitted.".
– grawity
Mar 8 '11 at 12:44
Writing to an "immutable" file would result in "Operation not permitted.".
– grawity
Mar 8 '11 at 12:44
add a comment |
- Go to your home folder
- Press Ctrl + H to show hidden files
- Check whether any of the folders are locked
- Right click on the folder then click "properties". In that click "permissions".
- Under owner, change folder access to "create and delete files."
- Click "Apply Permissions to Enclosed files"
If you cannot see any locked folders then select all folders and do the above
2
Somehow, I don't expect this to work in every case ;-) Hint: some people don't use the same DE as you do, or even any GUI at all.
– Psirus
Jan 31 '12 at 14:39
add a comment |
- Go to your home folder
- Press Ctrl + H to show hidden files
- Check whether any of the folders are locked
- Right click on the folder then click "properties". In that click "permissions".
- Under owner, change folder access to "create and delete files."
- Click "Apply Permissions to Enclosed files"
If you cannot see any locked folders then select all folders and do the above
2
Somehow, I don't expect this to work in every case ;-) Hint: some people don't use the same DE as you do, or even any GUI at all.
– Psirus
Jan 31 '12 at 14:39
add a comment |
- Go to your home folder
- Press Ctrl + H to show hidden files
- Check whether any of the folders are locked
- Right click on the folder then click "properties". In that click "permissions".
- Under owner, change folder access to "create and delete files."
- Click "Apply Permissions to Enclosed files"
If you cannot see any locked folders then select all folders and do the above
- Go to your home folder
- Press Ctrl + H to show hidden files
- Check whether any of the folders are locked
- Right click on the folder then click "properties". In that click "permissions".
- Under owner, change folder access to "create and delete files."
- Click "Apply Permissions to Enclosed files"
If you cannot see any locked folders then select all folders and do the above
edited Feb 12 '12 at 4:09
soandos
20.3k2892131
20.3k2892131
answered Jan 31 '12 at 13:59
AnushaSameerAnushaSameer
91
91
2
Somehow, I don't expect this to work in every case ;-) Hint: some people don't use the same DE as you do, or even any GUI at all.
– Psirus
Jan 31 '12 at 14:39
add a comment |
2
Somehow, I don't expect this to work in every case ;-) Hint: some people don't use the same DE as you do, or even any GUI at all.
– Psirus
Jan 31 '12 at 14:39
2
2
Somehow, I don't expect this to work in every case ;-) Hint: some people don't use the same DE as you do, or even any GUI at all.
– Psirus
Jan 31 '12 at 14:39
Somehow, I don't expect this to work in every case ;-) Hint: some people don't use the same DE as you do, or even any GUI at all.
– Psirus
Jan 31 '12 at 14:39
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%2f254644%2fwhy-cannot-overwrite-existing-file%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