Cannot delete a recently created directory in Lubuntu, or files in that directory
I created a directory in my home directory using the sudo mkdir command. Then I used the rsync command to do a backup of my pendrive into my newly created directory. The funny thing is, I cannot delete files in the newly created directory, or the directory itself (even when using sudo). I am using Lubnutu 14.04, where the root login is disabled. The strange thing is that the ownership of the newly created directory is root, where everything else in the home directory is owned by my screen name. How can I get rid of this directory?
|
You used sudo to create this directory. Why?
You can get rid of this directory if you use sudo in conjunction with rm -rf command. Be careful with that, it can destroy your installation/files if run on wrong directory. You can use sudo chown to change ownership of this directory and files in it, then you can delete it as your user, much safer. |
Quote:
rm = remove, r = recursive (meaning it will just keep repeating while it is allowed to) f = force (meaning it will not ask permission cause you have given it already). In other words it will keep removing things until it has nothing left to remove. you have 2 options 1. Open the directory you have the folder in as admin so Code:
sudo name-of-file-manager 2. Code:
sudo rm /path/to/folder |
If
Code:
sudo rm -r /home/foldersName |
Shouda been
Code:
$ mkdir redfacefreckledgirl I'd just gksu file manager and delete the root owned fie myself with a left click delete. KISS |
Quote:
|
Quote:
Might throw spacefm on it also. I browse different also in Ubuntu minimal install uri: https://launchpad.net/ubuntu/trusty/+package/uzbl Hence the logo difference on user agent. |
This command did the trick:
Quote:
But for some reason, a few minutes ago, I was able to create a new directory with sudo mkdir and then delete the empty directory with the sudo rmdir command. Hmmm. I don't fully understand what happend. I will remember not to use sudo when making directories. Thanks everyone for the help. I'm not familiar with the command below. It looks like I have some reading up to do. Quote:
|
Quote:
|
I've never looked into it that much:
Code:
man rm |
Quote:
A couple of years ago someone posted your "solution" on Ubuntu forums. Some people took it in good faith and used it promptly destroying their system. Shortly after a very stern warning was posted that anyone who posts that as a solution would have their membership revoked and would be permanently blocked from Ubuntu Forums. You may think its BS but unfortunately others have seen the side effects of it. Are you willing to help someone get their system back after using that command? Here is the updated thread. |
Code:
sudo rm -rf /some/directory |
Mistyping any commands with sudo could be bad that's why we use it, don't run this old *NIX joke:
Quote:
Code:
rm -rf / |
Too many beers?
|
Quote:
But the fact that the files exist prevent a rmdir /home/username from working. An rm -rf /home/username will work as that recursively deletes every file and directory contained there. |
All times are GMT -5. The time now is 07:37 AM. |