Is there an Unlink Command?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Is there an Unlink Command?

Dave Feustel
How do I unlink a previously linked directory name?
==============
/usr}sudo ln -f ports  #I tried this since I couldn't find an unlink command
ln: ports: is a directory
/usr}sudo rmdir ports
rmdir: ports: Not a directory
/usr}ls -l ports
lrwxr-xr-x  1 root  wheel  7 Nov 26 18:15 ports -> ports37
/usr}
==============

Thanks,
Dave  Feustel
--
Switch to Secure OpenBSD with a KDE desktop!!!
NOW with Virtual PC OS support via QEMU and
Beowulf clustering using PETSc and MPICH2!

Reply | Threaded
Open this post in threaded view
|

Re: Is there an Unlink Command?

Marc Espie-2
On Mon, Nov 28, 2005 at 04:58:08AM -0500, Dave Feustel wrote:

> How do I unlink a previously linked directory name?
> ==============
> /usr}sudo ln -f ports  #I tried this since I couldn't find an unlink command
> ln: ports: is a directory
> /usr}sudo rmdir ports
> rmdir: ports: Not a directory
> /usr}ls -l ports
> lrwxr-xr-x  1 root  wheel  7 Nov 26 18:15 ports -> ports37
> /usr}
> ==============
>
> Thanks,
> Dave  Feustel

It's called rm....

Reply | Threaded
Open this post in threaded view
|

Re: Is there an Unlink Command?

Dave Feustel
On Monday 28 November 2005 05:34, Marc Espie wrote:

> On Mon, Nov 28, 2005 at 04:58:08AM -0500, Dave Feustel wrote:
> > How do I unlink a previously linked directory name?
> > ==============
> > /usr}sudo ln -f ports  #I tried this since I couldn't find an unlink command
> > ln: ports: is a directory
> > /usr}sudo rmdir ports
> > rmdir: ports: Not a directory
> > /usr}ls -l ports
> > lrwxr-xr-x  1 root  wheel  7 Nov 26 18:15 ports -> ports37
> > /usr}
> > ==============
> >
> > Thanks,
> > Dave  Feustel
>
> It's called rm....

I finally figured that out. I thought there used to be
an unlink command (on ATT Unix).

--
Switch to Secure OpenBSD with a KDE desktop!!!
NOW with Virtual PC OS support via QEMU and
Beowulf clustering using PETSc and MPICH2!

Reply | Threaded
Open this post in threaded view
|

Re: Is there an Unlink Command?

Dave Feustel
In reply to this post by Dave Feustel
Thanks All!

rm did the trick.

Dave

On Monday 28 November 2005 05:44, Hannah Schroeter wrote:

> Hello!
>
> On Mon, Nov 28, 2005 at 04:58:08AM -0500, Dave Feustel wrote:
> >How do I unlink a previously linked directory name?
> >==============
> >/usr}sudo ln -f ports  #I tried this since I couldn't find an unlink command
> >ln: ports: is a directory
> >/usr}sudo rmdir ports
> >rmdir: ports: Not a directory
> >/usr}ls -l ports
> >lrwxr-xr-x  1 root  wheel  7 Nov 26 18:15 ports -> ports37
> >/usr}
> >==============
>
> You remove symlinks (regardless what they point to) with rm.
>
> >Thanks,
> >Dave  Feustel
>
> Kind regards,
>
> Hannah.
>

--
Switch to Secure OpenBSD with a KDE desktop!!!
NOW with Virtual PC OS support via QEMU and
Beowulf clustering using PETSc and MPICH2!

Reply | Threaded
Open this post in threaded view
|

Re: Is there an Unlink Command?

"Juan J." Martínez
In reply to this post by Dave Feustel
El lun, 28-11-2005 a las 04:58 -0500, Dave Feustel escribis:
> How do I unlink a previously linked directory name?

With rm (a linked directory is not a directory but a link to a
directory, that's a linked file directory entry).

>From rm(1):

The rm utility attempts to remove the non-directory type files specified
on the command line.[...]

regards,

Juanjo

--
Desarrollo y sistemas: http://www.usebox.net/
      Pagina Personal: http://www.usebox.net/jjm/

Reply | Threaded
Open this post in threaded view
|

Re: Is there an Unlink Command?

Christian Weisgerber
In reply to this post by Dave Feustel
Dave Feustel <[hidden email]> wrote:

> > It's called rm....
>
> I finally figured that out. I thought there used to be
> an unlink command (on ATT Unix).

Yes.

"Deleting" a file actually just means to remove a hard link.  The
corresponding syscall is unlink(2).  When no references are left,
the file is garbage collected.  The historical unlink(1) command
just calls unlink(2) directly without the smarts or error checking
that rm(1) performs.

--
Christian "naddy" Weisgerber                          [hidden email]