0

In my Downloads folder when I run ls I see the home directory, and I don't know why, I want to remove it but I am afraid to remove my home folder. Can anyone tell me how I can just remove the home directory in the Downloads folder and keep it in the root folder ?

here you can see a picture of what I get when I run ls command in the Downloads directory:

enter image description here

when I run the command:ls -la this what I get:

-rw------- 1 root root 1024 nov 28 20:24 ~

5
  • 6
    It is just a file called ~, not actually your home directory. – Celada Jan 13 '16 at 22:45
  • What gets returned if you type echo $HOME? – Paul Calabro Jan 13 '16 at 22:49
  • i get returned this: /home/user – rainman Jan 13 '16 at 22:51
  • What does ls -l ~/Downloads produce? (I think @Celada is correct, just double-checking) – Fabby Jan 13 '16 at 23:02
  • it produces this: -rw------- 1 root root 1024 nov 28 20:24 ~ – rainman Jan 13 '16 at 23:18
1

You are seeing a file named ~ in the Downloads directory; that symbol also happens to refer to your home directory, when used at the beginning of an unquoted string (here is what bash does).

To remove the file, you have many options; here are two of the simplest:

rm ~/Downloads/~
cd ~/Downloads && rm ./~

Add the -i flag to any of the rm commands to have it prompt you before removing the file.

2
  • and if i remove it i will not lose my original home directory ? – rainman Jan 14 '16 at 17:07
  • Correct. Just type one of those two commands – Jeff Schaller Jan 14 '16 at 17:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.