From owner-freebsd-questions@FreeBSD.ORG Wed Jun 28 01:07:26 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 2E78C16A413 for ; Wed, 28 Jun 2006 01:07:26 +0000 (UTC) (envelope-from b_oshea@yahoo.com) Received: from web39505.mail.mud.yahoo.com (web39505.mail.mud.yahoo.com [209.191.106.89]) by mx1.FreeBSD.org (Postfix) with SMTP id 38B1F44D80 for ; Tue, 27 Jun 2006 23:19:11 +0000 (GMT) (envelope-from b_oshea@yahoo.com) Received: (qmail 52371 invoked by uid 60001); 27 Jun 2006 23:19:10 -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=AZwjD/ySj029shH5qReHT5tvRofEwaGQthfc9iJQhTt8sH7GCUZag+6qPjcWZ+WCysIKDtrzQWar6h+c6zFeT/HroUDl9q5koeqCOO9MF/NM1kmnScaZSPZZ5qmyohTo6Spbc1bi+pUz+D2VN5Vf1ygzZxNj5qE4tA0J9DwuMQo= ; Message-ID: <20060627231910.52369.qmail@web39505.mail.mud.yahoo.com> Received: from [156.153.254.41] by web39505.mail.mud.yahoo.com via HTTP; Tue, 27 Jun 2006 16:19:10 PDT Date: Tue, 27 Jun 2006 16:19:10 -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: Wed, 28 Jun 2006 01:07:26 -0000 It can be done with a shell for-loop: $ mkdir a b c $ for dir in a b ; do (cd $dir ; ln -s ../c clink) ; done But this is technically not a single command, and it assumes that you are using the Bourne Shell (/bin/sh) or a Bourne-compatible shell (ksh, zsh, bash, etc.). If you are a csh or tcsh user, may God help you. (I mean look up the syntax in the appropriate man page.) -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 __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com