The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



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 !!

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

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-26-2006
hnhegde hnhegde is offline
Registered User
  
 

Join Date: Aug 2006
Posts: 22
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?
  #2 (permalink)  
Old 10-26-2006
hegemaro hegemaro is offline
Registered User
  
 

Join Date: Feb 2006
Location: Schenectady, NY
Posts: 134
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.
  #3 (permalink)  
Old 10-26-2006
hnhegde hnhegde is offline
Registered User
  
 

Join Date: Aug 2006
Posts: 22
Thanks hegemaro. I appreciate your quick reply.
  #4 (permalink)  
Old 10-26-2006
mayewil mayewil is offline
Registered User
  
 

Join Date: Oct 2006
Posts: 8
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
  #5 (permalink)  
Old 10-26-2006
hnhegde hnhegde is offline
Registered User
  
 

Join Date: Aug 2006
Posts: 22
Hi Bill,

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

This yields the same result set as:
find / -name <filename> -print
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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

BB 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 -4. The time now is 01:20 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0