Why can't I delete my files?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
I copied some files from a data DVD to /home/emma (ext4), and all of the files are read only.
This is what all of the files are like:
emma@emma-W54-55SU1-SUW:~$ stat cd/Drivers/Drivers_List.rtf
File: ‘cd/Drivers/Drivers_List.rtf’
Size: 28120 Blocks: 56 IO Block: 4096 regular file
Device: 801h/2049d Inode: 656521 Links: 1
Access: (0400/-r--------) Uid: ( 1000/ emma) Gid: ( 1000/ emma)
Access: 2014-01-17 05:34:46.000000000 +0000
Modify: 2014-01-17 05:34:46.000000000 +0000
Change: 2015-02-01 23:11:04.226865424 +0000
Birth: -
When I try to delete them, I get rm: cannot remove ‘cd/Drivers/Drivers_List.rtf’: Permission denied, even though I'm the owner. Changing the mode to 777 doesn't work either. The only thing that works is deleting them as root, using sudo.
I thought only an i attribute made files unable to be deleted by their owner, so what's going on?
I'm using Xubuntu 14.10.
Results of various commands:
(Please note: I created directory cd myself, and then copied directory Drivers to it from the DVD.)
emma@emma-W54-55SU1-SUW:~$ ls -dlh cd
drwxrwxr-x 3 emma emma 4.0K Feb 3 01:44 cd
emma@emma-W54-55SU1-SUW:~$ ls -dlh cd/Drivers
dr-x------ 11 emma emma 4.0K Feb 3 02:15 cd/Drivers
emma@emma-W54-55SU1-SUW:~$ ls -l cd/Drivers/Drivers_List.rtf
-r-------- 1 emma emma 28120 Jan 17 2014 cd/Drivers/Drivers_List.rtf
emma@emma-W54-55SU1-SUW:~$ rm cd/Drivers/Drivers_List.rtf
rm: cannot remove ‘cd/Drivers/Drivers_List.rtf’: Permission denied
emma@emma-W54-55SU1-SUW:~$ chmod 660 cd/Drivers/Drivers_List.rtf
emma@emma-W54-55SU1-SUW:~$ ls -l cd/Drivers/Drivers_List.rtf
-rw-rw---- 1 emma emma 28120 Jan 17 2014 cd/Drivers/Drivers_List.rtf
emma@emma-W54-55SU1-SUW:~$ rm cd/Drivers/Drivers_List.rtf
rm: cannot remove ‘cd/Drivers/Drivers_List.rtf’: Permission denied
emma@emma-W54-55SU1-SUW:~$ chmod 777 cd/Drivers/Drivers_List.rtf
emma@emma-W54-55SU1-SUW:~$ ls -l cd/Drivers/Drivers_List.rtf
-rwxrwxrwx 1 emma emma 28120 Jan 17 2014 cd/Drivers/Drivers_List.rtf
emma@emma-W54-55SU1-SUW:~$ rm cd/Drivers/Drivers_List.rtf
rm: cannot remove ‘cd/Drivers/Drivers_List.rtf’: Permission denied
emma@emma-W54-55SU1-SUW:~$ lsattr cd/Drivers/Drivers_List.rtf
-------------e-- cd/Drivers/Drivers_List.rtf
emma@emma-W54-55SU1-SUW:~$ ls -alh cd/Drivers
total 48K
dr-x------ 11 emma emma 4.0K Feb 3 02:15 .
drwxrwxr-x 3 emma emma 4.0K Feb 3 01:44 ..
dr-x------ 7 emma emma 4.0K Jan 14 2014 01Chipset
dr-x------ 3 emma emma 4.0K Jan 14 2014 02Video
dr-x------ 9 emma emma 4.0K Jan 14 2014 03Lan
dr-x------ 9 emma emma 4.0K Jan 14 2014 04CReader
dr-x------ 3 emma emma 4.0K Jan 17 2014 05Touchpad
dr-x------ 3 emma emma 4.0K Jan 14 2014 06Airplane
dr-x------ 2 emma emma 4.0K Jan 17 2014 07Hotkey
dr-x------ 12 emma emma 4.0K Jan 14 2014 08IME
dr-x------ 7 emma emma 4.0K Jan 14 2014 09Audio
-r-------- 1 emma emma 162 Feb 24 2012 ~$ivers_List.rtf
(I've already deleted cd/Drivers/Drivers_List.rtf using sudo as a test.)
permissions ext4 chmod xubuntu
add a comment |
I copied some files from a data DVD to /home/emma (ext4), and all of the files are read only.
This is what all of the files are like:
emma@emma-W54-55SU1-SUW:~$ stat cd/Drivers/Drivers_List.rtf
File: ‘cd/Drivers/Drivers_List.rtf’
Size: 28120 Blocks: 56 IO Block: 4096 regular file
Device: 801h/2049d Inode: 656521 Links: 1
Access: (0400/-r--------) Uid: ( 1000/ emma) Gid: ( 1000/ emma)
Access: 2014-01-17 05:34:46.000000000 +0000
Modify: 2014-01-17 05:34:46.000000000 +0000
Change: 2015-02-01 23:11:04.226865424 +0000
Birth: -
When I try to delete them, I get rm: cannot remove ‘cd/Drivers/Drivers_List.rtf’: Permission denied, even though I'm the owner. Changing the mode to 777 doesn't work either. The only thing that works is deleting them as root, using sudo.
I thought only an i attribute made files unable to be deleted by their owner, so what's going on?
I'm using Xubuntu 14.10.
Results of various commands:
(Please note: I created directory cd myself, and then copied directory Drivers to it from the DVD.)
emma@emma-W54-55SU1-SUW:~$ ls -dlh cd
drwxrwxr-x 3 emma emma 4.0K Feb 3 01:44 cd
emma@emma-W54-55SU1-SUW:~$ ls -dlh cd/Drivers
dr-x------ 11 emma emma 4.0K Feb 3 02:15 cd/Drivers
emma@emma-W54-55SU1-SUW:~$ ls -l cd/Drivers/Drivers_List.rtf
-r-------- 1 emma emma 28120 Jan 17 2014 cd/Drivers/Drivers_List.rtf
emma@emma-W54-55SU1-SUW:~$ rm cd/Drivers/Drivers_List.rtf
rm: cannot remove ‘cd/Drivers/Drivers_List.rtf’: Permission denied
emma@emma-W54-55SU1-SUW:~$ chmod 660 cd/Drivers/Drivers_List.rtf
emma@emma-W54-55SU1-SUW:~$ ls -l cd/Drivers/Drivers_List.rtf
-rw-rw---- 1 emma emma 28120 Jan 17 2014 cd/Drivers/Drivers_List.rtf
emma@emma-W54-55SU1-SUW:~$ rm cd/Drivers/Drivers_List.rtf
rm: cannot remove ‘cd/Drivers/Drivers_List.rtf’: Permission denied
emma@emma-W54-55SU1-SUW:~$ chmod 777 cd/Drivers/Drivers_List.rtf
emma@emma-W54-55SU1-SUW:~$ ls -l cd/Drivers/Drivers_List.rtf
-rwxrwxrwx 1 emma emma 28120 Jan 17 2014 cd/Drivers/Drivers_List.rtf
emma@emma-W54-55SU1-SUW:~$ rm cd/Drivers/Drivers_List.rtf
rm: cannot remove ‘cd/Drivers/Drivers_List.rtf’: Permission denied
emma@emma-W54-55SU1-SUW:~$ lsattr cd/Drivers/Drivers_List.rtf
-------------e-- cd/Drivers/Drivers_List.rtf
emma@emma-W54-55SU1-SUW:~$ ls -alh cd/Drivers
total 48K
dr-x------ 11 emma emma 4.0K Feb 3 02:15 .
drwxrwxr-x 3 emma emma 4.0K Feb 3 01:44 ..
dr-x------ 7 emma emma 4.0K Jan 14 2014 01Chipset
dr-x------ 3 emma emma 4.0K Jan 14 2014 02Video
dr-x------ 9 emma emma 4.0K Jan 14 2014 03Lan
dr-x------ 9 emma emma 4.0K Jan 14 2014 04CReader
dr-x------ 3 emma emma 4.0K Jan 17 2014 05Touchpad
dr-x------ 3 emma emma 4.0K Jan 14 2014 06Airplane
dr-x------ 2 emma emma 4.0K Jan 17 2014 07Hotkey
dr-x------ 12 emma emma 4.0K Jan 14 2014 08IME
dr-x------ 7 emma emma 4.0K Jan 14 2014 09Audio
-r-------- 1 emma emma 162 Feb 24 2012 ~$ivers_List.rtf
(I've already deleted cd/Drivers/Drivers_List.rtf using sudo as a test.)
permissions ext4 chmod xubuntu
What doesgrep /home /etc/mtabsay, just for completeness' sake?
– Ulrich Schwarz
Feb 2 '15 at 17:01
grep /home /etc/mtabreturns no matches.
– EmmaV
Feb 2 '15 at 17:22
3
What are the permissions on the cd and Drivers directories?
– terdon♦
Feb 2 '15 at 17:33
How come you runstat Drivers/Drivers_List.rtfbut the output is forcd/Drivers/Drivers_List.rtf? What is the relationship between the two?
– a CVn
Feb 2 '15 at 18:59
@MichaelKjörling: I forgot to copy theemma@emma-W54-55SU1-SUW:~$ stat cd/Drivers/Drivers_List.rtfline, so I added it in later, but I omitted thecd/part by mistake.
– EmmaV
Feb 2 '15 at 22:05
add a comment |
I copied some files from a data DVD to /home/emma (ext4), and all of the files are read only.
This is what all of the files are like:
emma@emma-W54-55SU1-SUW:~$ stat cd/Drivers/Drivers_List.rtf
File: ‘cd/Drivers/Drivers_List.rtf’
Size: 28120 Blocks: 56 IO Block: 4096 regular file
Device: 801h/2049d Inode: 656521 Links: 1
Access: (0400/-r--------) Uid: ( 1000/ emma) Gid: ( 1000/ emma)
Access: 2014-01-17 05:34:46.000000000 +0000
Modify: 2014-01-17 05:34:46.000000000 +0000
Change: 2015-02-01 23:11:04.226865424 +0000
Birth: -
When I try to delete them, I get rm: cannot remove ‘cd/Drivers/Drivers_List.rtf’: Permission denied, even though I'm the owner. Changing the mode to 777 doesn't work either. The only thing that works is deleting them as root, using sudo.
I thought only an i attribute made files unable to be deleted by their owner, so what's going on?
I'm using Xubuntu 14.10.
Results of various commands:
(Please note: I created directory cd myself, and then copied directory Drivers to it from the DVD.)
emma@emma-W54-55SU1-SUW:~$ ls -dlh cd
drwxrwxr-x 3 emma emma 4.0K Feb 3 01:44 cd
emma@emma-W54-55SU1-SUW:~$ ls -dlh cd/Drivers
dr-x------ 11 emma emma 4.0K Feb 3 02:15 cd/Drivers
emma@emma-W54-55SU1-SUW:~$ ls -l cd/Drivers/Drivers_List.rtf
-r-------- 1 emma emma 28120 Jan 17 2014 cd/Drivers/Drivers_List.rtf
emma@emma-W54-55SU1-SUW:~$ rm cd/Drivers/Drivers_List.rtf
rm: cannot remove ‘cd/Drivers/Drivers_List.rtf’: Permission denied
emma@emma-W54-55SU1-SUW:~$ chmod 660 cd/Drivers/Drivers_List.rtf
emma@emma-W54-55SU1-SUW:~$ ls -l cd/Drivers/Drivers_List.rtf
-rw-rw---- 1 emma emma 28120 Jan 17 2014 cd/Drivers/Drivers_List.rtf
emma@emma-W54-55SU1-SUW:~$ rm cd/Drivers/Drivers_List.rtf
rm: cannot remove ‘cd/Drivers/Drivers_List.rtf’: Permission denied
emma@emma-W54-55SU1-SUW:~$ chmod 777 cd/Drivers/Drivers_List.rtf
emma@emma-W54-55SU1-SUW:~$ ls -l cd/Drivers/Drivers_List.rtf
-rwxrwxrwx 1 emma emma 28120 Jan 17 2014 cd/Drivers/Drivers_List.rtf
emma@emma-W54-55SU1-SUW:~$ rm cd/Drivers/Drivers_List.rtf
rm: cannot remove ‘cd/Drivers/Drivers_List.rtf’: Permission denied
emma@emma-W54-55SU1-SUW:~$ lsattr cd/Drivers/Drivers_List.rtf
-------------e-- cd/Drivers/Drivers_List.rtf
emma@emma-W54-55SU1-SUW:~$ ls -alh cd/Drivers
total 48K
dr-x------ 11 emma emma 4.0K Feb 3 02:15 .
drwxrwxr-x 3 emma emma 4.0K Feb 3 01:44 ..
dr-x------ 7 emma emma 4.0K Jan 14 2014 01Chipset
dr-x------ 3 emma emma 4.0K Jan 14 2014 02Video
dr-x------ 9 emma emma 4.0K Jan 14 2014 03Lan
dr-x------ 9 emma emma 4.0K Jan 14 2014 04CReader
dr-x------ 3 emma emma 4.0K Jan 17 2014 05Touchpad
dr-x------ 3 emma emma 4.0K Jan 14 2014 06Airplane
dr-x------ 2 emma emma 4.0K Jan 17 2014 07Hotkey
dr-x------ 12 emma emma 4.0K Jan 14 2014 08IME
dr-x------ 7 emma emma 4.0K Jan 14 2014 09Audio
-r-------- 1 emma emma 162 Feb 24 2012 ~$ivers_List.rtf
(I've already deleted cd/Drivers/Drivers_List.rtf using sudo as a test.)
permissions ext4 chmod xubuntu
I copied some files from a data DVD to /home/emma (ext4), and all of the files are read only.
This is what all of the files are like:
emma@emma-W54-55SU1-SUW:~$ stat cd/Drivers/Drivers_List.rtf
File: ‘cd/Drivers/Drivers_List.rtf’
Size: 28120 Blocks: 56 IO Block: 4096 regular file
Device: 801h/2049d Inode: 656521 Links: 1
Access: (0400/-r--------) Uid: ( 1000/ emma) Gid: ( 1000/ emma)
Access: 2014-01-17 05:34:46.000000000 +0000
Modify: 2014-01-17 05:34:46.000000000 +0000
Change: 2015-02-01 23:11:04.226865424 +0000
Birth: -
When I try to delete them, I get rm: cannot remove ‘cd/Drivers/Drivers_List.rtf’: Permission denied, even though I'm the owner. Changing the mode to 777 doesn't work either. The only thing that works is deleting them as root, using sudo.
I thought only an i attribute made files unable to be deleted by their owner, so what's going on?
I'm using Xubuntu 14.10.
Results of various commands:
(Please note: I created directory cd myself, and then copied directory Drivers to it from the DVD.)
emma@emma-W54-55SU1-SUW:~$ ls -dlh cd
drwxrwxr-x 3 emma emma 4.0K Feb 3 01:44 cd
emma@emma-W54-55SU1-SUW:~$ ls -dlh cd/Drivers
dr-x------ 11 emma emma 4.0K Feb 3 02:15 cd/Drivers
emma@emma-W54-55SU1-SUW:~$ ls -l cd/Drivers/Drivers_List.rtf
-r-------- 1 emma emma 28120 Jan 17 2014 cd/Drivers/Drivers_List.rtf
emma@emma-W54-55SU1-SUW:~$ rm cd/Drivers/Drivers_List.rtf
rm: cannot remove ‘cd/Drivers/Drivers_List.rtf’: Permission denied
emma@emma-W54-55SU1-SUW:~$ chmod 660 cd/Drivers/Drivers_List.rtf
emma@emma-W54-55SU1-SUW:~$ ls -l cd/Drivers/Drivers_List.rtf
-rw-rw---- 1 emma emma 28120 Jan 17 2014 cd/Drivers/Drivers_List.rtf
emma@emma-W54-55SU1-SUW:~$ rm cd/Drivers/Drivers_List.rtf
rm: cannot remove ‘cd/Drivers/Drivers_List.rtf’: Permission denied
emma@emma-W54-55SU1-SUW:~$ chmod 777 cd/Drivers/Drivers_List.rtf
emma@emma-W54-55SU1-SUW:~$ ls -l cd/Drivers/Drivers_List.rtf
-rwxrwxrwx 1 emma emma 28120 Jan 17 2014 cd/Drivers/Drivers_List.rtf
emma@emma-W54-55SU1-SUW:~$ rm cd/Drivers/Drivers_List.rtf
rm: cannot remove ‘cd/Drivers/Drivers_List.rtf’: Permission denied
emma@emma-W54-55SU1-SUW:~$ lsattr cd/Drivers/Drivers_List.rtf
-------------e-- cd/Drivers/Drivers_List.rtf
emma@emma-W54-55SU1-SUW:~$ ls -alh cd/Drivers
total 48K
dr-x------ 11 emma emma 4.0K Feb 3 02:15 .
drwxrwxr-x 3 emma emma 4.0K Feb 3 01:44 ..
dr-x------ 7 emma emma 4.0K Jan 14 2014 01Chipset
dr-x------ 3 emma emma 4.0K Jan 14 2014 02Video
dr-x------ 9 emma emma 4.0K Jan 14 2014 03Lan
dr-x------ 9 emma emma 4.0K Jan 14 2014 04CReader
dr-x------ 3 emma emma 4.0K Jan 17 2014 05Touchpad
dr-x------ 3 emma emma 4.0K Jan 14 2014 06Airplane
dr-x------ 2 emma emma 4.0K Jan 17 2014 07Hotkey
dr-x------ 12 emma emma 4.0K Jan 14 2014 08IME
dr-x------ 7 emma emma 4.0K Jan 14 2014 09Audio
-r-------- 1 emma emma 162 Feb 24 2012 ~$ivers_List.rtf
(I've already deleted cd/Drivers/Drivers_List.rtf using sudo as a test.)
permissions ext4 chmod xubuntu
permissions ext4 chmod xubuntu
edited Feb 3 '15 at 2:58
EmmaV
asked Feb 2 '15 at 16:50
EmmaVEmmaV
1,2171337
1,2171337
What doesgrep /home /etc/mtabsay, just for completeness' sake?
– Ulrich Schwarz
Feb 2 '15 at 17:01
grep /home /etc/mtabreturns no matches.
– EmmaV
Feb 2 '15 at 17:22
3
What are the permissions on the cd and Drivers directories?
– terdon♦
Feb 2 '15 at 17:33
How come you runstat Drivers/Drivers_List.rtfbut the output is forcd/Drivers/Drivers_List.rtf? What is the relationship between the two?
– a CVn
Feb 2 '15 at 18:59
@MichaelKjörling: I forgot to copy theemma@emma-W54-55SU1-SUW:~$ stat cd/Drivers/Drivers_List.rtfline, so I added it in later, but I omitted thecd/part by mistake.
– EmmaV
Feb 2 '15 at 22:05
add a comment |
What doesgrep /home /etc/mtabsay, just for completeness' sake?
– Ulrich Schwarz
Feb 2 '15 at 17:01
grep /home /etc/mtabreturns no matches.
– EmmaV
Feb 2 '15 at 17:22
3
What are the permissions on the cd and Drivers directories?
– terdon♦
Feb 2 '15 at 17:33
How come you runstat Drivers/Drivers_List.rtfbut the output is forcd/Drivers/Drivers_List.rtf? What is the relationship between the two?
– a CVn
Feb 2 '15 at 18:59
@MichaelKjörling: I forgot to copy theemma@emma-W54-55SU1-SUW:~$ stat cd/Drivers/Drivers_List.rtfline, so I added it in later, but I omitted thecd/part by mistake.
– EmmaV
Feb 2 '15 at 22:05
What does
grep /home /etc/mtab say, just for completeness' sake?– Ulrich Schwarz
Feb 2 '15 at 17:01
What does
grep /home /etc/mtab say, just for completeness' sake?– Ulrich Schwarz
Feb 2 '15 at 17:01
grep /home /etc/mtab returns no matches.– EmmaV
Feb 2 '15 at 17:22
grep /home /etc/mtab returns no matches.– EmmaV
Feb 2 '15 at 17:22
3
3
What are the permissions on the cd and Drivers directories?
– terdon♦
Feb 2 '15 at 17:33
What are the permissions on the cd and Drivers directories?
– terdon♦
Feb 2 '15 at 17:33
How come you run
stat Drivers/Drivers_List.rtf but the output is for cd/Drivers/Drivers_List.rtf? What is the relationship between the two?– a CVn
Feb 2 '15 at 18:59
How come you run
stat Drivers/Drivers_List.rtf but the output is for cd/Drivers/Drivers_List.rtf? What is the relationship between the two?– a CVn
Feb 2 '15 at 18:59
@MichaelKjörling: I forgot to copy the
emma@emma-W54-55SU1-SUW:~$ stat cd/Drivers/Drivers_List.rtf line, so I added it in later, but I omitted the cd/ part by mistake.– EmmaV
Feb 2 '15 at 22:05
@MichaelKjörling: I forgot to copy the
emma@emma-W54-55SU1-SUW:~$ stat cd/Drivers/Drivers_List.rtf line, so I added it in later, but I omitted the cd/ part by mistake.– EmmaV
Feb 2 '15 at 22:05
add a comment |
5 Answers
5
active
oldest
votes
I believe some additional information is necessary for a certain answer, but I would suspect the issue is simply permissions related. I'm guessing either you accidentally copied symlinks over instead of the real files, or you're trying to delete the entire directory but haven't reset permissions on all the files within.
First things first, when you stat the file it gives a path of 'cd/Drivers/Drivers_List.rtf', which seems to be different than the directory you're referencing in your commands. Can you confirm that you copied the files instead of creating symlinks? Providing the results of these three commands would be very useful in seeing what's going on:
ls -alhd /home/emma/cdls -alhd /home/emma/Driversls -alh /home/emma/Drivers
Second, please attempt the following to see if you can remove a single file from the collection:
chmod 660 "/home/emma/Drivers/Drivers_List.rtf"rm "/home/emma/Drivers/Drivers_List.rtf"
Let us know how that goes, and provide any errors you receive!
Thanks. Regarding the path discrepancy, I forgot to copy theemma@emma-W54-55SU1-SUW:~$ stat cd/Drivers/Drivers_List.rtfline, so I added it in later, but I omitted thecd/part by mistake. Regarding symlinks, yes I am 100% certain that I copied files and not symlinks. I used Midnight Commander, with 'Preserve attributes' checked. I'll try what you suggested and report back when I get a chance.
– EmmaV
Feb 2 '15 at 22:18
I've added all of the results of the commands now. I've also discovered that not evenchmod 777makes them able to be deleted, so I must have made a mistake the first time.
– EmmaV
Feb 3 '15 at 2:39
Ah, I see. Took a bit of looking, but I believe doing achmod u+w -R ~/cdwill do the trick for you. To delete a file, you need write permissions to the directory that file is in, not just the file itself (ref: stackoverflow.com/questions/8175697/… and unix.stackexchange.com/questions/49638/…)
– immortal squish
Feb 3 '15 at 20:55
add a comment |
As you're working on a ext4 filesystem it could be possible that those files have the inmutable attribute enabled. You should check it with lsattr. Ex:
antonio@PC1:~/antonio/borrar$ lsattr undelete
-u--i--------e-- undelete
Thanks for your suggestion, but they aren't immutable. If they were, I wouldn't have been able to delete them usingsudo.
– EmmaV
Feb 2 '15 at 22:12
add a comment |
Try doing:
sudo rm path/to/file
if you cant do that then try
sudo rm -r path/to/file
Thanks for the suggestion. I already stated thatsudoworks. What I'm asking is why I can't delete the files without usingsudowhen I'm the owner.
– EmmaV
Feb 2 '15 at 22:10
because when talking about computers, the computer does know who the actual owner is, but everything saved on your account of the computer, you are the owner of. Anything from or copied from another place (other than the web), will always have different permissions.
– Viraj Shah
Feb 3 '15 at 2:02
add a comment |
I've found the answer myself here.
Because cd/Drivers is read-only, only root can delete from it.
add a comment |
I was about to answer with the issue being you're trying to remove a read-only file inside of a directory you have write permissions on.
Try resetting the permissions on the folder recursively with chmod -R 700 /home/emma/cd
It'll be from when you copied preserving permissions inside of MC.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
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: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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%2funix.stackexchange.com%2fquestions%2f182498%2fwhy-cant-i-delete-my-files%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
I believe some additional information is necessary for a certain answer, but I would suspect the issue is simply permissions related. I'm guessing either you accidentally copied symlinks over instead of the real files, or you're trying to delete the entire directory but haven't reset permissions on all the files within.
First things first, when you stat the file it gives a path of 'cd/Drivers/Drivers_List.rtf', which seems to be different than the directory you're referencing in your commands. Can you confirm that you copied the files instead of creating symlinks? Providing the results of these three commands would be very useful in seeing what's going on:
ls -alhd /home/emma/cdls -alhd /home/emma/Driversls -alh /home/emma/Drivers
Second, please attempt the following to see if you can remove a single file from the collection:
chmod 660 "/home/emma/Drivers/Drivers_List.rtf"rm "/home/emma/Drivers/Drivers_List.rtf"
Let us know how that goes, and provide any errors you receive!
Thanks. Regarding the path discrepancy, I forgot to copy theemma@emma-W54-55SU1-SUW:~$ stat cd/Drivers/Drivers_List.rtfline, so I added it in later, but I omitted thecd/part by mistake. Regarding symlinks, yes I am 100% certain that I copied files and not symlinks. I used Midnight Commander, with 'Preserve attributes' checked. I'll try what you suggested and report back when I get a chance.
– EmmaV
Feb 2 '15 at 22:18
I've added all of the results of the commands now. I've also discovered that not evenchmod 777makes them able to be deleted, so I must have made a mistake the first time.
– EmmaV
Feb 3 '15 at 2:39
Ah, I see. Took a bit of looking, but I believe doing achmod u+w -R ~/cdwill do the trick for you. To delete a file, you need write permissions to the directory that file is in, not just the file itself (ref: stackoverflow.com/questions/8175697/… and unix.stackexchange.com/questions/49638/…)
– immortal squish
Feb 3 '15 at 20:55
add a comment |
I believe some additional information is necessary for a certain answer, but I would suspect the issue is simply permissions related. I'm guessing either you accidentally copied symlinks over instead of the real files, or you're trying to delete the entire directory but haven't reset permissions on all the files within.
First things first, when you stat the file it gives a path of 'cd/Drivers/Drivers_List.rtf', which seems to be different than the directory you're referencing in your commands. Can you confirm that you copied the files instead of creating symlinks? Providing the results of these three commands would be very useful in seeing what's going on:
ls -alhd /home/emma/cdls -alhd /home/emma/Driversls -alh /home/emma/Drivers
Second, please attempt the following to see if you can remove a single file from the collection:
chmod 660 "/home/emma/Drivers/Drivers_List.rtf"rm "/home/emma/Drivers/Drivers_List.rtf"
Let us know how that goes, and provide any errors you receive!
Thanks. Regarding the path discrepancy, I forgot to copy theemma@emma-W54-55SU1-SUW:~$ stat cd/Drivers/Drivers_List.rtfline, so I added it in later, but I omitted thecd/part by mistake. Regarding symlinks, yes I am 100% certain that I copied files and not symlinks. I used Midnight Commander, with 'Preserve attributes' checked. I'll try what you suggested and report back when I get a chance.
– EmmaV
Feb 2 '15 at 22:18
I've added all of the results of the commands now. I've also discovered that not evenchmod 777makes them able to be deleted, so I must have made a mistake the first time.
– EmmaV
Feb 3 '15 at 2:39
Ah, I see. Took a bit of looking, but I believe doing achmod u+w -R ~/cdwill do the trick for you. To delete a file, you need write permissions to the directory that file is in, not just the file itself (ref: stackoverflow.com/questions/8175697/… and unix.stackexchange.com/questions/49638/…)
– immortal squish
Feb 3 '15 at 20:55
add a comment |
I believe some additional information is necessary for a certain answer, but I would suspect the issue is simply permissions related. I'm guessing either you accidentally copied symlinks over instead of the real files, or you're trying to delete the entire directory but haven't reset permissions on all the files within.
First things first, when you stat the file it gives a path of 'cd/Drivers/Drivers_List.rtf', which seems to be different than the directory you're referencing in your commands. Can you confirm that you copied the files instead of creating symlinks? Providing the results of these three commands would be very useful in seeing what's going on:
ls -alhd /home/emma/cdls -alhd /home/emma/Driversls -alh /home/emma/Drivers
Second, please attempt the following to see if you can remove a single file from the collection:
chmod 660 "/home/emma/Drivers/Drivers_List.rtf"rm "/home/emma/Drivers/Drivers_List.rtf"
Let us know how that goes, and provide any errors you receive!
I believe some additional information is necessary for a certain answer, but I would suspect the issue is simply permissions related. I'm guessing either you accidentally copied symlinks over instead of the real files, or you're trying to delete the entire directory but haven't reset permissions on all the files within.
First things first, when you stat the file it gives a path of 'cd/Drivers/Drivers_List.rtf', which seems to be different than the directory you're referencing in your commands. Can you confirm that you copied the files instead of creating symlinks? Providing the results of these three commands would be very useful in seeing what's going on:
ls -alhd /home/emma/cdls -alhd /home/emma/Driversls -alh /home/emma/Drivers
Second, please attempt the following to see if you can remove a single file from the collection:
chmod 660 "/home/emma/Drivers/Drivers_List.rtf"rm "/home/emma/Drivers/Drivers_List.rtf"
Let us know how that goes, and provide any errors you receive!
answered Feb 2 '15 at 17:34
immortal squishimmortal squish
21615
21615
Thanks. Regarding the path discrepancy, I forgot to copy theemma@emma-W54-55SU1-SUW:~$ stat cd/Drivers/Drivers_List.rtfline, so I added it in later, but I omitted thecd/part by mistake. Regarding symlinks, yes I am 100% certain that I copied files and not symlinks. I used Midnight Commander, with 'Preserve attributes' checked. I'll try what you suggested and report back when I get a chance.
– EmmaV
Feb 2 '15 at 22:18
I've added all of the results of the commands now. I've also discovered that not evenchmod 777makes them able to be deleted, so I must have made a mistake the first time.
– EmmaV
Feb 3 '15 at 2:39
Ah, I see. Took a bit of looking, but I believe doing achmod u+w -R ~/cdwill do the trick for you. To delete a file, you need write permissions to the directory that file is in, not just the file itself (ref: stackoverflow.com/questions/8175697/… and unix.stackexchange.com/questions/49638/…)
– immortal squish
Feb 3 '15 at 20:55
add a comment |
Thanks. Regarding the path discrepancy, I forgot to copy theemma@emma-W54-55SU1-SUW:~$ stat cd/Drivers/Drivers_List.rtfline, so I added it in later, but I omitted thecd/part by mistake. Regarding symlinks, yes I am 100% certain that I copied files and not symlinks. I used Midnight Commander, with 'Preserve attributes' checked. I'll try what you suggested and report back when I get a chance.
– EmmaV
Feb 2 '15 at 22:18
I've added all of the results of the commands now. I've also discovered that not evenchmod 777makes them able to be deleted, so I must have made a mistake the first time.
– EmmaV
Feb 3 '15 at 2:39
Ah, I see. Took a bit of looking, but I believe doing achmod u+w -R ~/cdwill do the trick for you. To delete a file, you need write permissions to the directory that file is in, not just the file itself (ref: stackoverflow.com/questions/8175697/… and unix.stackexchange.com/questions/49638/…)
– immortal squish
Feb 3 '15 at 20:55
Thanks. Regarding the path discrepancy, I forgot to copy the
emma@emma-W54-55SU1-SUW:~$ stat cd/Drivers/Drivers_List.rtf line, so I added it in later, but I omitted the cd/ part by mistake. Regarding symlinks, yes I am 100% certain that I copied files and not symlinks. I used Midnight Commander, with 'Preserve attributes' checked. I'll try what you suggested and report back when I get a chance.– EmmaV
Feb 2 '15 at 22:18
Thanks. Regarding the path discrepancy, I forgot to copy the
emma@emma-W54-55SU1-SUW:~$ stat cd/Drivers/Drivers_List.rtf line, so I added it in later, but I omitted the cd/ part by mistake. Regarding symlinks, yes I am 100% certain that I copied files and not symlinks. I used Midnight Commander, with 'Preserve attributes' checked. I'll try what you suggested and report back when I get a chance.– EmmaV
Feb 2 '15 at 22:18
I've added all of the results of the commands now. I've also discovered that not even
chmod 777 makes them able to be deleted, so I must have made a mistake the first time.– EmmaV
Feb 3 '15 at 2:39
I've added all of the results of the commands now. I've also discovered that not even
chmod 777 makes them able to be deleted, so I must have made a mistake the first time.– EmmaV
Feb 3 '15 at 2:39
Ah, I see. Took a bit of looking, but I believe doing a
chmod u+w -R ~/cd will do the trick for you. To delete a file, you need write permissions to the directory that file is in, not just the file itself (ref: stackoverflow.com/questions/8175697/… and unix.stackexchange.com/questions/49638/…)– immortal squish
Feb 3 '15 at 20:55
Ah, I see. Took a bit of looking, but I believe doing a
chmod u+w -R ~/cd will do the trick for you. To delete a file, you need write permissions to the directory that file is in, not just the file itself (ref: stackoverflow.com/questions/8175697/… and unix.stackexchange.com/questions/49638/…)– immortal squish
Feb 3 '15 at 20:55
add a comment |
As you're working on a ext4 filesystem it could be possible that those files have the inmutable attribute enabled. You should check it with lsattr. Ex:
antonio@PC1:~/antonio/borrar$ lsattr undelete
-u--i--------e-- undelete
Thanks for your suggestion, but they aren't immutable. If they were, I wouldn't have been able to delete them usingsudo.
– EmmaV
Feb 2 '15 at 22:12
add a comment |
As you're working on a ext4 filesystem it could be possible that those files have the inmutable attribute enabled. You should check it with lsattr. Ex:
antonio@PC1:~/antonio/borrar$ lsattr undelete
-u--i--------e-- undelete
Thanks for your suggestion, but they aren't immutable. If they were, I wouldn't have been able to delete them usingsudo.
– EmmaV
Feb 2 '15 at 22:12
add a comment |
As you're working on a ext4 filesystem it could be possible that those files have the inmutable attribute enabled. You should check it with lsattr. Ex:
antonio@PC1:~/antonio/borrar$ lsattr undelete
-u--i--------e-- undelete
As you're working on a ext4 filesystem it could be possible that those files have the inmutable attribute enabled. You should check it with lsattr. Ex:
antonio@PC1:~/antonio/borrar$ lsattr undelete
-u--i--------e-- undelete
answered Feb 2 '15 at 21:21
Antonio VazquezAntonio Vazquez
112
112
Thanks for your suggestion, but they aren't immutable. If they were, I wouldn't have been able to delete them usingsudo.
– EmmaV
Feb 2 '15 at 22:12
add a comment |
Thanks for your suggestion, but they aren't immutable. If they were, I wouldn't have been able to delete them usingsudo.
– EmmaV
Feb 2 '15 at 22:12
Thanks for your suggestion, but they aren't immutable. If they were, I wouldn't have been able to delete them using
sudo.– EmmaV
Feb 2 '15 at 22:12
Thanks for your suggestion, but they aren't immutable. If they were, I wouldn't have been able to delete them using
sudo.– EmmaV
Feb 2 '15 at 22:12
add a comment |
Try doing:
sudo rm path/to/file
if you cant do that then try
sudo rm -r path/to/file
Thanks for the suggestion. I already stated thatsudoworks. What I'm asking is why I can't delete the files without usingsudowhen I'm the owner.
– EmmaV
Feb 2 '15 at 22:10
because when talking about computers, the computer does know who the actual owner is, but everything saved on your account of the computer, you are the owner of. Anything from or copied from another place (other than the web), will always have different permissions.
– Viraj Shah
Feb 3 '15 at 2:02
add a comment |
Try doing:
sudo rm path/to/file
if you cant do that then try
sudo rm -r path/to/file
Thanks for the suggestion. I already stated thatsudoworks. What I'm asking is why I can't delete the files without usingsudowhen I'm the owner.
– EmmaV
Feb 2 '15 at 22:10
because when talking about computers, the computer does know who the actual owner is, but everything saved on your account of the computer, you are the owner of. Anything from or copied from another place (other than the web), will always have different permissions.
– Viraj Shah
Feb 3 '15 at 2:02
add a comment |
Try doing:
sudo rm path/to/file
if you cant do that then try
sudo rm -r path/to/file
Try doing:
sudo rm path/to/file
if you cant do that then try
sudo rm -r path/to/file
answered Feb 2 '15 at 21:48
Viraj ShahViraj Shah
101
101
Thanks for the suggestion. I already stated thatsudoworks. What I'm asking is why I can't delete the files without usingsudowhen I'm the owner.
– EmmaV
Feb 2 '15 at 22:10
because when talking about computers, the computer does know who the actual owner is, but everything saved on your account of the computer, you are the owner of. Anything from or copied from another place (other than the web), will always have different permissions.
– Viraj Shah
Feb 3 '15 at 2:02
add a comment |
Thanks for the suggestion. I already stated thatsudoworks. What I'm asking is why I can't delete the files without usingsudowhen I'm the owner.
– EmmaV
Feb 2 '15 at 22:10
because when talking about computers, the computer does know who the actual owner is, but everything saved on your account of the computer, you are the owner of. Anything from or copied from another place (other than the web), will always have different permissions.
– Viraj Shah
Feb 3 '15 at 2:02
Thanks for the suggestion. I already stated that
sudo works. What I'm asking is why I can't delete the files without using sudo when I'm the owner.– EmmaV
Feb 2 '15 at 22:10
Thanks for the suggestion. I already stated that
sudo works. What I'm asking is why I can't delete the files without using sudo when I'm the owner.– EmmaV
Feb 2 '15 at 22:10
because when talking about computers, the computer does know who the actual owner is, but everything saved on your account of the computer, you are the owner of. Anything from or copied from another place (other than the web), will always have different permissions.
– Viraj Shah
Feb 3 '15 at 2:02
because when talking about computers, the computer does know who the actual owner is, but everything saved on your account of the computer, you are the owner of. Anything from or copied from another place (other than the web), will always have different permissions.
– Viraj Shah
Feb 3 '15 at 2:02
add a comment |
I've found the answer myself here.
Because cd/Drivers is read-only, only root can delete from it.
add a comment |
I've found the answer myself here.
Because cd/Drivers is read-only, only root can delete from it.
add a comment |
I've found the answer myself here.
Because cd/Drivers is read-only, only root can delete from it.
I've found the answer myself here.
Because cd/Drivers is read-only, only root can delete from it.
edited Apr 13 '17 at 12:36
Community♦
1
1
answered Feb 3 '15 at 14:55
EmmaVEmmaV
1,2171337
1,2171337
add a comment |
add a comment |
I was about to answer with the issue being you're trying to remove a read-only file inside of a directory you have write permissions on.
Try resetting the permissions on the folder recursively with chmod -R 700 /home/emma/cd
It'll be from when you copied preserving permissions inside of MC.
add a comment |
I was about to answer with the issue being you're trying to remove a read-only file inside of a directory you have write permissions on.
Try resetting the permissions on the folder recursively with chmod -R 700 /home/emma/cd
It'll be from when you copied preserving permissions inside of MC.
add a comment |
I was about to answer with the issue being you're trying to remove a read-only file inside of a directory you have write permissions on.
Try resetting the permissions on the folder recursively with chmod -R 700 /home/emma/cd
It'll be from when you copied preserving permissions inside of MC.
I was about to answer with the issue being you're trying to remove a read-only file inside of a directory you have write permissions on.
Try resetting the permissions on the folder recursively with chmod -R 700 /home/emma/cd
It'll be from when you copied preserving permissions inside of MC.
edited 1 hour ago
Rui F Ribeiro
41.9k1483142
41.9k1483142
answered Feb 3 '15 at 15:15
Anthony HoltAnthony Holt
11
11
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- 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%2funix.stackexchange.com%2fquestions%2f182498%2fwhy-cant-i-delete-my-files%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
What does
grep /home /etc/mtabsay, just for completeness' sake?– Ulrich Schwarz
Feb 2 '15 at 17:01
grep /home /etc/mtabreturns no matches.– EmmaV
Feb 2 '15 at 17:22
3
What are the permissions on the cd and Drivers directories?
– terdon♦
Feb 2 '15 at 17:33
How come you run
stat Drivers/Drivers_List.rtfbut the output is forcd/Drivers/Drivers_List.rtf? What is the relationship between the two?– a CVn
Feb 2 '15 at 18:59
@MichaelKjörling: I forgot to copy the
emma@emma-W54-55SU1-SUW:~$ stat cd/Drivers/Drivers_List.rtfline, so I added it in later, but I omitted thecd/part by mistake.– EmmaV
Feb 2 '15 at 22:05