Find Command Experts - I'm Stumped - Redhat

This is a discussion on Find Command Experts - I'm Stumped - Redhat ; I'm trying to use the find command to set up soft links in a users folder from say a CAD drawings folder. Here's an example: find '/home/Drawings/BSA/Top Assemblies' -print gives me a full path name: /home/Drawings/Assemblies/F91472.cad but how do I ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Find Command Experts - I'm Stumped

  1. Find Command Experts - I'm Stumped

    I'm trying to use the find command to set up soft links in a users
    folder from say a CAD drawings folder. Here's an example:

    find '/home/Drawings/BSA/Top Assemblies' -print

    gives me a full path name:

    /home/Drawings/Assemblies/F91472.cad

    but how do I execute a link command to create that files name in the
    users home directory:

    /home/debbie/F91472.cad


    can you somehow grep the filename out of the output and use it with
    the -exec ln {} ?????

    Any ideas?

    Thanks in Advance,

    Walter

  2. Re: Find Command Experts - I'm Stumped

    On Thu, 01 Apr 2004 18:00:31 -0800, Walter wrote:

    > I'm trying to use the find command to set up soft links in a users
    > folder from say a CAD drawings folder. Here's an example:
    >
    > find '/home/Drawings/BSA/Top Assemblies' -print
    >
    > gives me a full path name:
    >
    > /home/Drawings/Assemblies/F91472.cad
    >
    > but how do I execute a link command to create that files name in the
    > users home directory:
    >
    > /home/debbie/F91472.cad
    >
    >
    > can you somehow grep the filename out of the output and use it with
    > the -exec ln {} ?????
    >


    Does '-exec ln -s {} /home/debbie/' not work?

    Jacob

  3. Re: Find Command Experts - I'm Stumped

    google.15.walt750@spamgourmet.com (Walter) writes:
    >I'm trying to use the find command to set up soft links in a users
    >folder from say a CAD drawings folder. Here's an example:
    >
    >find '/home/Drawings/BSA/Top Assemblies' -print


    This probably won't do what you think, as it will decend
    into subdirectories.

    If all you want to do is link all the non-directory files from
    one directory to another using symbolic links, try this:

    cd /home/Drawings/Assemblies
    for _file in /home/Drawings/BSA/Top?Assemblies/*.cad
    do
    ln -s ${_file} $(basename ${_file})
    done

    It can be done directly from the command line, or in a script.

    (And putting spaces in directory names can be problematic at times).

    scott

    >
    >gives me a full path name:
    >
    >/home/Drawings/Assemblies/F91472.cad
    >
    >but how do I execute a link command to create that files name in the
    >users home directory:
    >
    >/home/debbie/F91472.cad
    >
    >
    >can you somehow grep the filename out of the output and use it with
    >the -exec ln {} ?????
    >
    >Any ideas?
    >
    >Thanks in Advance,
    >
    >Walter


+ Reply to Thread