Folder-Terminal problem!!

Guys… Firstly I apologise for not searching more in the forum for a solution and posting a thread!!
I was searching (playing) on the terminal of my laptop and from curiosity I created a folder with the name ‘~’ !!!
I know that this may be the most stupid thin ever but now when I try to change its name or move it to another folder or just delete it (don’t try it) it takes as folder the ‘root’ if I’m logged in as root and ‘home’ if I’m logged in as ‘user’… How can I change its name or delete that folder without deleting any of my home or root folders ???
I can’t even open it from terminal to see what’s inside, for example with ‘cd’, ‘ls -l’ command!!!

Thanks in advance !!!

On 2012-11-14 19:16, Wizark OS wrote:

> ‘home’ if I’m logged in as ‘user’… How can I change its name or
> delete that folder without deleting any of my home or root folders ???
> I can’t even open it from terminal to see what’s inside, for example
> with ‘cd’, ‘ls -l’ command!!!

:slight_smile:

Try


ls \~

>


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” (Minas Tirith))

And the explanation is:

The ~ typed in the bash as the starting element in a path is catched by the bash and replaced with the name of the home directory of the user typing. See ~ aliasing in the man page of bash.

When you want to use the ~ itself, you should “escape” it to make bash not aliasing it. And the \ is a perfect character to do “escaping” in this case.

… I know that this may be the most stupid thin ever …

Not realy. But I would recommend you to read through the bash man page (not all in one go, that will make you insane) and/or some good bash documentation guide to understand what you are doing. At least when you want to do more things in a terminal with bash.

Edit: there are many more solitions when you read the above. e.g. not letting the ~ be the first element in the path by using e.g.

ls ./~

when you are in the directory where ~ is. Or

ls /home/wizark/~

thus an absolute path to it.

Home work: find more solutions until you understand that this is in fact a non-problem :wink: