Linux RM – How to Delete a Directory Named ‘~’ Accidentally Created

directoryfilenamesrm

I don't remember exactly how this directory got created. It's name is ~, the alternative we all use for home diretory. I also see a sticky bit attached with this directory. How shall I delete it? I fear running a normal rmdir would delete all the files from the home directory recursively. Here are the details :

mtk4@laptop:~/temp$ ls -l
total 4
drwxrwxr-t 2 mtk4 mtk4 4096 Oct 17 2011 ~

How shall I proceed?

Another question : What does the total number specify on the first line of output of ls -l ? '4' in this case. There is just 1 directory as shown(other than . and ..).

I am using ubuntu 12.04.

Also asked same question on askubuntu, as it seems to be relavant on both sites.

Best Answer

Just quote the directory. I use rmdir just to ensure you don't accidently delete your home directory.

rmdir "~"

For your other question (better to create a extra question for it) total means the total file size of the directory (sum of the file sizes in the output). If you use -h it will show you the size in a human readable format.

ls -lh