Subject: bug#21051: direct/file deletion

From: Bob Proulx <[email-masked]>
Date: Tue, 14 Jul 2015 16:54:01 -0600

Lee Sung wrote:
> [lsung@hw-lnx-shell3 ~/fpc_i2cs_cpld]$ ls -al
> total 28
> drwxr-xr-x   3 lsung ipg        4096 Jul 13 11:23 .
> drwxr-xr-x  26 lsung qa-others 20480 Jul 13 11:40 ..
> drwxr-xr-x   2 lsung ipg        4096 Jul 13 11:23 rtl
> 
> I want to delete  dir fpc_i2cs_cpld, but I cannot.

Easiest is to change directory one above and then delete it.  The
easiest way is with rm -r -f which will perform a recursive removal of
everything in the directory depth first from the bottom up.

  cd ..
  rm -rf fpc_i2cs_cpld  # warning: recursive removal

But you could also delete it using the full path.

  rm -rf ~/fpc_i2cs_cpld  # warning: recursive removal

> How would I delete directory "." and ".."

Those entries are required infrastructure and should not be deleted.
The "." directory refers to the current directory.  The ".." refers to
the parent directory.  The ".." entry on some classic Unix file
systems may be unlinked but I don't believe that any current Linux
file system allows this.  This is a restriction imposed by the kernel
and not by coreutils.

Bob