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, 2016 at 22:45
  • What gets returned if you type echo $HOME? Jan 13, 2016 at 22:49
  • i get returned this: /home/user
    – rainman
    Jan 13, 2016 at 22:51
  • What does ls -l ~/Downloads produce? (I think @Celada is correct, just double-checking)
    – Fabby
    Jan 13, 2016 at 23:02
  • it produces this: -rw------- 1 root root 1024 nov 28 20:24 ~
    – rainman
    Jan 13, 2016 at 23:18

1 Answer 1

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, 2016 at 17:07
  • Correct. Just type one of those two commands
    – Jeff Schaller
    Jan 14, 2016 at 17:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .