Solved

How to remove a file named ".."

Posted on 2000-05-09
6
253 Views
Last Modified: 2010-04-20
There is a directory named ".." (created with a perl script)

System does not allow to use rm -r -f /home/www/...

How can I delete it?
0
Comment
Question by:Bigi
6 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 2794621
. is a link to the parent directory, it should not be removed
0
 
LVL 1

Expert Comment

by:friebele
ID: 2794769
Actually, in any directory there are two files which are links to directories. "." is a link to the current, ".." is a link to the parent directory. Typing "cd .." makes you change to the parent directory. It is not possible to remove these.
0
 
LVL 3

Expert Comment

by:paulnic
ID: 2794875
have you tried a Perl script?  ;-)
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 40

Expert Comment

by:jlevie
ID: 2796032
As pointed out, "." & ".." are supposed to be in each directory and you can't remove them without damaging the directory structure. Furthermore the filesystem typically won't allow you to delete or to create nodes with those names. However, it is possible to create something that looks remarkably similar, say " .." or ".. ". The spaces that are a part of the name may not be obvious from ls (a control character in a file name can do the same thing), but are obvious  if you look at the directory with emacs/xemacs in dired mode or from a readdir() call. If the node name includes leading or trailing white space it can be removed by quoting the name, i.e., rmdir ".. ".
0
 
LVL 84

Accepted Solution

by:
ozo earned 100 total points
ID: 2797098
(I did say ".." above, but E-E removes "." when it's the first character in a comment)
0
 
LVL 1

Expert Comment

by:anwar12
ID: 2797687
".",".." are directories which are blanks and when u get in you also got nothing.
just like in ms-dos prompt when u type "dir" in one of your directory it also got that 2 directories.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Penetration Testing home based work 3 75
linux(debian) mouse poor performance 4 41
awk to variable in bash 2 43
how to configure linux OS using Ubuntu 7 43
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question