A Unix question: find command

Hi all,
Sorry for posting a Unix question here.
In the following directory I have:
/opt/SonicSoftware/SonicMQ/samples/TopicPubSub/DurableChat>ls
DurableChat.class DurableChat.java Readme.txt
However, if I try:
/opt/SonicSoftware>find -iname DurableChat.class
The path can not be found, it just gives me the prompt back; I don't know what the reason is. Any idea?

I'm just wondering can the symbolic link be the
reason that class file can not be found (I guess, not
though, b/c other classes can be found):What do you mean "not found"?
Do you mean why the find command isn't finding it? Yes, that's why. But now that you know, you can use -follow.
Or do you mean the VM is unable to find the class at runtime? I'm almost certain the classloader can follow symbolic links in the classpath, so I don't think that's the problem.
>
/opt/SonicSoftware/SonicMQ/samples/TopicPubSub/Chat>..
/../SonicMQ.sh DurableChat -u AlwaysUp
Exception in thread "main"
java.lang.NoClassDefFoundError: DurableChat
Should I change the path that it won't be symbolic
anymore?Try it and see if it fixes it. I'd be surprised, but you never know. If making it not a link fixes it, then maybe that's what you have to do. If it doesn't fix it, then you know you have to look somewhere else.

Similar Messages

  • A Unix question: grep command

    Hi all,
    I have a directory which contains more directories, and each directory has more directories inside, which in turn may or may not contain Java files. I need to use the grep command in the way that from the first directory goes into the directories recursively, finds the Java files and tell me what files have the PATTERN= "Basic Import Validation".
    I used the grep like this, but guess its wrong since haven't received any response so far. Can sb. please tell me if I've used the command correctly or how should I change it? Any help is greatly appreciated.
    dir> grep -r --include="Basic Import Validation" *.java                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    I gues the reason this isn't working for you isthat
    -r means "process all subdirectories of any
    directories listed in the command line args."
    grep never sees the *.java that you supply. Theshell
    grabs that and expands it to list all the .javafiles
    in the pwd.If you can, would you please explain a little more,
    what you meant by above?
    grep whatever *.java When you type that command, your shell (bash, zsh, ksh, tcsh, etc.) is the program that receives that string on its standard input--like Java's System.in. The shell sees *.java and expands it into a list of all the .java files in the current directory. Then the shell invokes grep, and passes on the list of those java files.
    But the list of .java files in the pwd has nothing to do with any java files that might be in subdirs.
    If you use the -r arg, it seems that, in the list of "files" (where you put *.java), if any of those "files" are in fact directories, then -r means to look in files in that dir and its subdirs, rather than treating that arg as a file to examine.
    So you'd put . (dot) as your current dir, and then use the --include to tell grep which files to process and which to ignore.
    I'm sure about the shell expanding *.java. I'm not completely sure about my interpretation of -r and --include, but I'm pretty confident that's right.
    As you said, the way I used grep, didn't return any
    result. Your solution however, gave me results and
    found the Java files containing the PATTERN. Thanks a
    lot.You're welcome.
    If you're still interested, it's probably worth trying out my slight modification to your original solution. If it works, it's a bit cleaner and simpler.

  • Simple Java Command-Line on Unix Question

    From the windows shell, the following command works fine:
    java -classpath MyJar.jar;. Test
    The class Test, in the current director, depends on files in MyJar.jar. However, when I open up the cygwin bash shell and try to execute the same command, I get this error:
    bash: /usr/bin/Test: No such file or directory
    It appears it's looking for Test in /usr/bin as opposed to in the current directory. Why is this happening and how can I get this to work in bash?
    I know it's kind of unix question, but I figured some one here could help.
    TIA,
    John

    How can I use aboslute classpaths within bash. For
    example, what it the bash equivalent of the
    following:
    java -classpath C:/Java;C:/Java/MyJar.jar Testjava -classpath /the/path/to/your/Java:/the/path/to/your/MyJar.jar Test
    Normally you will be using things relative to your home directory so yo can use
    java -classpath ~ /the/relative-path/to/your/Java:~/the/relarive-path/to/your/MyJar.jar Test
    or
    java -classpath $HOME/the/relative-path/to/your/Java:$HOME/the/relative-path/to/your/MyJar.jar Test
    Please don't use these blindly. Spend some time (half a day say) looking at the bash shell!

  • Help please! [using Runtime.exec() to run find command in UNIX]

    Hi guys! im trying to use exec() to run the UNIX find command
    that my application uses. As you can see from my sample code, the find command finds all files ending with html in my home directory. Unfortunately when I run the program it doesn't give me an output, but when I run it on the shell in the same directory as this code is saved, it works perfectly fine.
    Could someone please help me on this one. Many thanks! =)
    import java.io.*;
    import java.lang.String;
    public class RunCommand {
            public static void main(String[] args) {
                    try {
                            String[] command = {"find", "~/", "-name",
                                            "*.html", "-print"};
                            String find_str;
                            Process find_proc = Runtime.getRuntime().exec(
                                            command);
                            DataInputStream find_in = new DataInputStream(
                                            find_proc.getInputStream());
                            try {
                                    while ((find_str = find_in.readLine())
                                                                    != null) {
                                            System.out.println(find_str);
                            } catch (IOException e) {
                                    System.exit(0);
                    } catch (IOException e1) {
                            System.err.println(e1);
                            System.exit(1);
                    System.exit(0);
    }

    I don't see anythi obvious. In both catch blocks, call printSckTrace on the exception yhou caught.
    I think the real culprit is the ~ though.
    ~ is interpreted by some (most?) shells to men home dir. However, when you just exec a command, you don't have a shell to do that interpretation for you, so it's looking for a directory that's literally named ~.
    Either exec a shell (read the man pages for the shell of your choice, but for zsh I think it's "/bin/zsh -c find ~ blah blah blah) or else just put the actual path to your home directory into the string you pass to exec. You can get that from System.getProperty("user.home").

  • Unix find command...

    My problem exists with the behavior on the unix find command, or my lack of understanding of it.
    For example, I work for a graphics company and we have a constant folder structure like this:
    *12345 Apple - Poster*
    ~....~01_Layouts
    ~....~02_Images
    ~....~03_Fonts
    ~....~04ClientOriginals
    ~........~01.28.08_14:46
    ~........~03.07.08_15.03
    ~........~03.10.08_17.22
    When we receive files from a customer, the CSR creates a folder inside 04ClientOriginals following a format like 03.06.08_10.15, and copies the files/folders from customer supplied media into them.
    I have set up a launchd script that finds all of the date/time stamped folders inside of 04ClientOriginals that have not been modified within the past month and stuff them with the Stuffit command line utility. I do that with this command:
    find . -type d –mtime +30 -ipath #/04ClientOriginals/# -exec /usr/local/bin/stuff -f sit5 -m 2 -o -D {} \;
    This command works fine except in those cases where there are folders over 30 days old inside of a parent directory that is not 30 days old yet. I only want the find to descend to one level below 04ClientOriginals, and no further.
    I thought by adding an extra "/" at the end of the path #/04ClientOriginals/#/ instead of #/04ClientOriginals/# would keep it from descending further down, but when I try this the search returns no results. Also, I can’t use -maxdepth in my find arguments because the depth of 04ClientOriginals is not always constant.
    Any help would be greatly appreciated.
    Thanks.
    Edit: Due to the lack of decent markup tools for formatting code on the Apple Discussion Board, the wildcards in my file paths have been substituted with a "#". Kind of ridiculous for a unix discussion board to not have code highlighting capability.
    Message was edited by: Guriboy

    etresoft wrote:
    I don't know if these will work or not. Regular expressions are powerful, but tricky. Plus, there are a few different, but similar, varieties. Also, I don't know if the find within a find syntax will work. This might be something that is better suited to Perl. You would then have much more control over what you are doing.
    Running this find command finds exactly what I'm looking for:
    find . -type d -name "04ClientOriginals" -exec find {} -mtime +30 -type d -maxdepth 1 ;
    I hope I'm wrong, but can't you call -exec only once? As a test I ran this:
    find . -type d -name "04ClientOriginals" -exec find {} -mtime +30 -type d -maxdepth 1 -exec ls -l {} ;
    If I invoke -exec a second time, I get this error:
    find: -exec: no terminating ";" or "+"
    find: -exec: no terminating ";" or "+"
    find: -exec: no terminating ";" or "+"
    I've searched high and low and I cannot find an example of the find command calling -exec more than once.
    My regex skills are pretty weak, so I'll only tread those waters if I have to.

  • How to ignore subdirectories in find command of unix

    how to exclude subdirectories of a path from find command
    /app
    /app/fmbs
    /app/fmbs/temp
    find /app/fmbs -name *.fmb
    i want to ignore any fmb file existing into subdirectories created under temp subdirectory.
    regards

    Not sure if this helps but instead of using "find" as you are giving a specific path why not use "ls"
    Example:
    # ls /app/fmbs | grep ".fmd" (This will list all file names in specified directory)
    or
    # ls /app/fmbs/*.fmd (This will list all file names & path in specified directory)
    I hope this helps
    I am working on increasing our list of useful 1 liner commands and what we've got can be found at unbreakablehelp.com main page left hand side there are two links.
    Enjoy it.

  • ICal Find Command is not active

    I have tried to use the Find Command in iCal. It doesn't work either from the Edit pull down command nor the keyboard command. Can you try this in your setup and tell me whether it works?
    I have an Intel Mac Mini running 10.4.9.
    Bob Gallant

    You may want to post your question in the iCal forums:
    http://discussions.apple.com/category.jspa?categoryID=166

  • File path from find command and using POSIX

    Hi,
    I have a find command in do shell script returning output files of the form ./xyz/abc/.../...
    instead of the full path.
    I am guessing that this is the problem when I use POSIX path of one of those files. Can Applescript understand the "./" or does it need a full Unix path to convert it back?
    In that case, how do I ask find command to return the full path?
    Thanks in advance!

    >I am guessing that this is the problem when I use POSIX path of one of those files. Can Applescript understand the "./" or does it need a full Unix path to convert it back?
    You're right - AppleScript won't be able to use those paths because AppleScript has no idea of the current directory used by the shell.
    The problem is that you're defining '.' a the start point of your search.
    For each matching file find will print this start point in front of the relative path, assuming that you know where you're starting from. So the solution is to provide that path as the search start point rather than .
    For example, if your current script says:
    <pre class=command>cd /some/directory
    find . -name "*.mp3"</pre>
    You could/should rewrite this as:
    <pre class=command>find /some/directory -name "*.mp3"</pre>
    in the second case all matches would include the full path including the /some/directory part.
    If you can't predict what your search directory will be you can write your find like this:
    <pre class=command>find `pwd` -name "*.mp3"</pre>
    which will fill in the current directory (via pwd at the time the search is executed and will output full paths that AppleScript can work with.

  • Why is the Find command in Notes always disabled?

    I would like to be able to locate text inside of notes in the Mac OS X version of Notes. The Find, Find Next, Find Previous, and Find Selected Text commands all exist in the Edit>Find sub-menu but they're always disabled. Is there something wrong with my installation of Mountain Lion or are these commands always disabled? How can I enable these Find commands in Notes?

    Entering text in the search sidebar filters the notes containing the text entered in the box, but it does not enable the Find commands nor highlight the text within the note. If you want to find the desired text within a very long note —and I'm sure we all have a few— you must copy the text into another application and use that application's Find command, make your changes, then paste the text back into the note.
    My question still stands. How can I enable the Find command which exists in Notes but which is always disabled? Is this simply a feature that was planned but never implemented? If the command was never intended to work in Notes, why was it included in the menu? Finally, since the Find command is standard in every other text editor, why would it not be included in Notes?
    As a Mac developer, I'm tempted to try and hack it into working, but I'd rather not have to.

  • Find command

    this will find lsminst file in current dir, how i can find some file if i dont know its dir name?
    find . -name lsminst -print

    please mind you are giving way too few information about what you are trying to accomplish.
    this question differs fundamentally from the first one!
    If you don't know anything, searching from a file from the root directory (/) would be wise. This can take a long time (just like in windows :-) )
    find / -name "thefileiamsearchingfor"
    Can you elaborate on what you want?
    the find command gives way more flexibility and options than windows (try: man find)

  • Find Command Not Searching System Folders

    This seems like a tough question to answer but I cannot find a way to use the Finder's "Find" command to find files in the User/Library/ folder (ie: looking for specific preference files) or any other System folder for that matter.
    I was trying to find a certain ".plist" file using the "Find" command but even typing the exact, full name of the ".plist" file directly into the search box still wouldn't bring up a result in the list. I had to manually go into the Preferences folder and locate the file.
    Is this a limitation of the Finder's "Find" command or is there some way I can "tell" it to look in all the System folders?
    Thanks so much,
    Gerard

    Also, see http://www.pinkmutant.com/articles/Leopard/leospot.html and my mod to Finder's Find at http://discussions.apple.com/message.jspa?messageID=6725932 for what you can change so you can find stuff excluded by the default structure.

  • Does find command work on Time Machine Volumes

    Trying to help someone search for instances of a file that is within a Time Machine backup. When using the UNIX find command it seems to take a lot longer to run than one would expect with the amount of data on the Time Machine disk.
    Does anyone know if find (in 10.5.8) can search Time Machine backups?

    I've had a find running on my TM disk for about 4 hours now and it hasn't returned anything. Don't think it should take that long to search through ~350 Gig worth of files.
    But it doesn't look like 350GB to find. Rather it looks like 350GB times the number of TimeMachine increments you have.
    Or more correctly, if you have 1 million files on your disk (I actually have 1.2 million), and if you have 50 TimeMachine increments, then find thinks you have 50 million files to be searched.
    And most likely each file access is going to be at least 1 disk access, so that would be 50 million disk accesses. Your typical hard disk is good for 50 to 100 disk accesses per second, so that could be over 100 hours on a good day. That seems a bit long, so my guess about 1 access per file is most likely too high, but I'm still sure that accessing 50 million files is going to take a long time (hours).

  • A Unix question

    Hi everybody,
    I'm trying to find a regular file, file is not hidden, but it resides under a hidden directory; the 'find' command: find -name <filename>
    can not find the file under a hidden directory. Is there any other solution to find the file?
    Any help is greatly appreciated.

    Um, I'm not sure what you're doing, but "yes it can" is the only answer I can see given what you've specified:
    dcminter@fatmoggy:~/bar$ ls -al
    total 8
    drwxr-xr-x    2 dcminter users        4096 Jun  1 23:42 ./
    drwxr-xr-x   16 dcminter users        4096 Jun  1 23:40 ../No directories at present
    dcminter@fatmoggy:~/bar$ mkdir .fooCreated a hidden directory.
    dcminter@fatmoggy:~/bar$ touch .foo/temp.txtCreated a normal file in the hidden directory. Now we'll view the current directory (including the hidden one within it):
    dcminter@fatmoggy:~/bar$ ls -al
    total 12
    drwxr-xr-x    3 dcminter users        4096 Jun  1 23:42 ./
    drwxr-xr-x   16 dcminter users        4096 Jun  1 23:40 ../
    drwxr-xr-x    2 dcminter users        4096 Jun  1 23:42 .foo/Ok, that looks good - now lets make sure it's really hidden:
    dcminter@fatmoggy:~/bar$ lsOk, no output from that, so it's hidden. Now we'll run the find commant:
    dcminter@fatmoggy:~/bar$ find -name temp.txt
    ./.foo/temp.txtThere's the file in the hidden directory. No problem.
    I can only assume that you mean something different by "hidden directory" from what I mean - or that the "hidden directory" isn't actually there (and that this is why you can't find the file)...
    D.

  • Find Command in iCal doesn't work

    I have tried to use the Find Command in iCal. It doesn't work either from the Edit pull down command nor the keyboard command. Please try this in your setup and tell me whether it works?
    I have an Intel Mac Mini running 10.4.9.
    Bob Gallant

    Hi Bob,
    It works for me.
    Find will only search in selected calendars. Do you have the relevant calendars checked in the calendar list? (you can select all calendars by Command-Clicking one checkbox)
    Best wishes
    John M

  • Incomplete Finder find command results

    In Tiger I would use the search box in any Finder window to look for files. It would do a decent job of sorting and it displayed results sorted by "type" of file. With Leopard I cannot find folders or files in the user's Library folder (and other places). Is there a way to get Finder's find command to do a more thorough search? BTW I usually look for folders and files by name.

    system files are excluded from searches by default. to include them do the following.
    type command+f to bring up a search window. Click on "kind", scroll down and select "Other". in the resulting popup choose "system files" and set to include.

Maybe you are looking for

  • IOS6...exchange email account problems....iPad

    I just installed iOS6 on my iPhone 4 and "new iPad"....had a lot of issues with icloud but seemed to have resolved those issues. However, my exchange email and hotmail live account will not sync on my iPad. The iPhone appears to have adapted well, bu

  • 1280x1024 to 1280x720

    for example, i recorded the game video with Fraps, 1280x1024, now i want resolution to be 1280x720, when the programm starts adobe animated cartoon, we must create a project, there must choose one of the popular format video, so here i like pick: AVC

  • Number of rows in all of your tables.

    Hello, If I want to discover the number of rows in all of my tables (e.g. I own 20 tables and each table has 50 rows), why is the following code not providing the answer: SELECT count(*) FROM (SELECT table_name FROM all_tables WHERE owner = 'SHIRISH'

  • Downloading the file through transaction F110.

    Hi all,        My requirement is to generate a payment file in EFT format(comma separated format) and to download that file to a PC location using the transaction F110. The EFT file needs to generated automatically after the payment run. So I am copy

  • Problem in refreshing jinternalframe

    Hello, In java code I have added jtable to jinternalframe and on each button click I have to show new values filled in jtable which is in jinternalframe.But I am getting new jinternalframe next to original jinternalframe.I want new jinternalframe to