From owner-freebsd-questions@FreeBSD.ORG Tue Jun 27 22:55:00 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 17D7E16A407 for ; Tue, 27 Jun 2006 22:55:00 +0000 (UTC) (envelope-from b_oshea@yahoo.com) Received: from web39512.mail.mud.yahoo.com (web39512.mail.mud.yahoo.com [209.191.106.96]) by mx1.FreeBSD.org (Postfix) with SMTP id ABCD144B7A for ; Tue, 27 Jun 2006 22:54:59 +0000 (GMT) (envelope-from b_oshea@yahoo.com) Received: (qmail 11549 invoked by uid 60001); 27 Jun 2006 22:54:55 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=nqNsGDHPaNJQFeAFNT9qL9C+YXhCSXa6lWhcA2+SiP5bCenJMKe/EXMWZna2LO6Ei8h8GVeUwnn2/noRQyM4E57f1lBD0Rjat79u6MCfUZ3oQt+o2BEgOJg9A2gLbpoV9tDw+r8aHurcspELMJm57GpZO7ft1UziABsqhE+KmFQ= ; Message-ID: <20060627225455.11547.qmail@web39512.mail.mud.yahoo.com> Received: from [156.153.254.41] by web39512.mail.mud.yahoo.com via HTTP; Tue, 27 Jun 2006 15:54:54 PDT Date: Tue, 27 Jun 2006 15:54:54 -0700 (PDT) From: Brian O'Shea To: sara lidgey , freebsd-questions@freebsd.org In-Reply-To: <20060627181422.6917.qmail@web35702.mail.mud.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Cc: Subject: Re: multiple links with single ln command X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jun 2006 22:55:00 -0000 Unfortunately, it is impossible with the current syntax of the ln command. It does allow you to specify multiple sources as arguments though, with a final argument naming a target directory in which to create the links to the source files. For example: $ mkdir test $ mkdir test/a $ mkdir test/b $ mkdir test/c $ mkdir links $ cd ./links $ ln -s ../test/* . $ ls -l lrwxr-xr-x 1 boshea boshea 9 Jun 27 15:50 a -> ../test/a lrwxr-xr-x 1 boshea boshea 9 Jun 27 15:50 b -> ../test/b lrwxr-xr-x 1 boshea boshea 9 Jun 27 15:50 c -> ../test/c However, this is not exactly what you are trying to do in your example; you are trying to create multiple target links with the same name in different directories. Unfortunately, because the ln command's syntax allows you to specify multiple source files, it would be ambiguous to try to make it also allow you to specify multiple targets. Hope that helps. -brian --- sara lidgey wrote: > Hi All, > > I've read the man page for ln but can't find a way to do this. I want to > create multiple links to a single directory with one command. Consider the > following example. I have a directory structure like this: > test/a/ > test/b/ > test/c/ > I want to create a symbolic link called "clink" in test/a/ and test/b/ which > points to test/c/ > > The only way I know to do this is with two commands: > ln -s test/c test/a/clink > ln -s test/c test/b/clink > > Can it be done with a single command? > > thanks. sorry if this is a no-brainer, > S > > > --------------------------------- > Now you can have a huge leap forward in email: get the new Yahoo! Mail. > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com