The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM
Home Forums Register Rules & FAQ Members List Arcade Search Today's Posts Mark Forums Read


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!


Other UNIX.COM Threads You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
question on find and remove command arunkumar_mca UNIX for Dummies Questions & Answers 1 12-10-2007 09:54 PM
how to find a file named vijay in a directory using find command amirthraj_12 UNIX for Dummies Questions & Answers 5 10-25-2006 02:39 PM
Find command question negixx Shell Programming and Scripting 6 07-08-2005 08:43 AM
command find returned bash: /usr/bin/find: Argument list too long yacsil Shell Programming and Scripting 1 12-15-2003 02:38 PM
'find' command question xyyz UNIX for Dummies Questions & Answers 2 03-07-2002 03:28 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-26-2006
Registered User
 

Join Date: Aug 2006
Posts: 22
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
question about find command

I am not sure if this question has been answered earlier at the Unix Forums. I tried a search but could not find anything.
So here it goes...

I am looking for a log file under /home.
Code:
find /home dklog.log -print
This prints all the directories it traverses while looking for the file and in the end the search result is printed. An extract of the output is:
Code:
/home/f029778/AuditFlag
/home/f029778/AuditFlag/scripts
/home/f029778/AuditFlag/scripts/1.sh
/home/f029778/AuditFlag/scripts/2.sh
/home/f029778/AuditFlag/scripts/3.sh
/home/f029778/AuditFlag/scripts/4.sh
/home/f029778/AuditFlag/scripts/6.sh
/home/f029778/AuditFlag/scripts/7.sh
/home/f029778/AuditFlag/scripts/8.sh
/home/f029778/AuditFlag/scripts/GEA.sh
/home/f029778/AuditFlag/scripts/HEA1.sh
/home/f029778/AuditFlag/scripts/HEA2.sh
/home/f029778/AuditFlag/scripts/KEA.sh
/home/f029778/AuditFlag/scripts/KEA1.sh
/home/f029778/AuditFlag/scripts/SEA.sh
/home/f029778/AuditFlag/scripts/SEA4.sh
/home/f029778/AuditFlag/scripts/count.sh
/home/f029778/delme.sh
/home/f029778/file2.dat
/home/f029778/file1.dat
/home/f029778/tools
/home/f029778/tools/bin
/home/f029778/tools/bin/citadel_user_manager.sh
/home/f029778/tools/bin/dklog.log
/home/f029778/tools/dklog.log
/home/f029778/tools/lib
/home/f029778/tools/lib/citadel-tools.jar
/home/f029778/tools/lib/jconn2.jar
/home/f029778/tools/log
/home/f029778/tools/tp_groups.dat
/home/f029778/tools/tp_users.dat
dklog.log
Is there an option to just print the result, in this case and avoid the rest of the stuff?
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 10-26-2006
Registered User
 

Join Date: Feb 2006
Location: Schenectady, NY
Posts: 130
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
You're close:

find /home -name dklog.log -print

If your /home directory structure is automounted, say from /export/home, you would want to use the latter as your path.
Reply With Quote
  #3 (permalink)  
Old 10-26-2006
Registered User
 

Join Date: Aug 2006
Posts: 22
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
Thanks hegemaro. I appreciate your quick reply.
Reply With Quote
  #4 (permalink)  
Old 10-26-2006
Registered User
 

Join Date: Oct 2006
Posts: 8
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
Not sure if this will help but try

find / -name '<filename>' -print

Include the tick marks each side of filename. You should only get back the location(s) of file you search for. Observe the spacing between forward slash and -name

Bill
Reply With Quote
  #5 (permalink)  
Old 10-26-2006
Registered User
 

Join Date: Aug 2006
Posts: 22
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
Hi Bill,

Thanks for the quick reply. I tried:
find / -name '<filename>' -print

This yields the same result set as:
find / -name <filename> -print
Reply With Quote
Google UNIX.COM
Reply



Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -7. The time now is 05:23 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger

Search Engine Optimization by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102