Sponsored Content
Full Discussion: question about find command
Top Forums UNIX for Dummies Questions & Answers question about find command Post 302094285 by hnhegde on Thursday 26th of October 2006 12:17:56 PM
Old 10-26-2006
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?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

'find' command question

my solaris text talks about the 'find' command... it further goes to talk about an "action" used with the find command. I am completely confused as to what the {} do with the find comand. the explanation is this: "A set of braces, {}, delimits where the file name is passed to the command from... (2 Replies)
Discussion started by: xyyz
2 Replies

2. Shell Programming and Scripting

Find command question

Hi All, I am trying to use the find command to search and delete files and have the following scenario. How come the file in the current directory is not getting listed out? /glo71sw/716/devl/userdata/ftpord --> ls -lt XSKU* -rw-r--r-- 1 root sys 137493 Jul 7 18:30... (6 Replies)
Discussion started by: negixx
6 Replies

3. UNIX for Dummies Questions & Answers

question on find and remove command

Hi All, I have wrote a command to find a and remove all *.apr files ina directory . Now i got the request as reversed , They want to remove all files except *.apr in the direcory . Is it possible to do that in a find comand else i have give an explicit find command to all *. files to... (1 Reply)
Discussion started by: arunkumar_mca
1 Replies

4. UNIX for Dummies Questions & Answers

FIND command question revisited

I'm using this in AIX to find what file contains the value 'batch' in it, in all directories. find / -type f -exec grep -l batch {} /dev/null \; My question is, what if I only wanted to search *.sh files, and I wanted to pipe the results to a file called 'batch_find.txt'. How could I code... (3 Replies)
Discussion started by: NycUnxer
3 Replies

5. UNIX for Dummies Questions & Answers

awk and find command question

Hello! I have written this script: for file in "$( find $dirName -type d )" do echo "$file" echo "hello" done but as a result I get all the directories and in the end the work "hello". Shouldn't it print the word "hello" after printing the name of each directory and not in the end? ... (1 Reply)
Discussion started by: GeorgeP
1 Replies

6. Shell Programming and Scripting

find command question

Hi I need to find the command ("find" , "grep" etc..) which would give me the full path and file name of all the files in the entire directory tree which contain the line "/bbsrc/doc/". What would be the most efficient way to do it? Thanks a lot for advice -A (6 Replies)
Discussion started by: aoussenko
6 Replies

7. Shell Programming and Scripting

Find command question

Hi, I want to search in the log directory only. This log directory exists at mutiple places in my directory tree. I know that to exclude any directory we have option - prune but can we do the just opposite of it.. just check a single directory and exclude the rest. thanks (3 Replies)
Discussion started by: manojgarg
3 Replies

8. UNIX for Dummies Questions & Answers

Find Command Question

I was using this find command to search for this string find /usr/reports -name '*.txt' -type f -exec grep -l tbl_out:add_19 {} \; > /usr/work/junk.txt My question is, if I want to search another type of file extension besides '*.txt' how can I include it on the same line to say something... (5 Replies)
Discussion started by: NycUnxer
5 Replies

9. Shell Programming and Scripting

find command question

Hi all, I want to use find to 'find' files older than a file. The command I have come up with so far is find . -type f ! -newer filename -print | grep -v filename If I dont use the -v then the filename is included in the output is there a better way of formulating this command... (1 Reply)
Discussion started by: jonnyd
1 Replies

10. UNIX for Dummies Questions & Answers

A question on find command

I need to find all files with file names starting with alert and ending with .log I mean, the following files should be returnrned alertTST.log alertabcdefgh.log How can i do this ? (4 Replies)
Discussion started by: kraljic
4 Replies
HAMEXAM(1)						      General Commands Manual							HAMEXAM(1)

NAME hamexam - Study guide for USA FCC amateur radio (ham radio) license examinations.
SYNOPSIS
hamexam [option] DESCRIPTION
hamexam presents questions in random order from the selected question pool, and terminates when all questions have been answered correctly. The session may be interrupted with ^C, and resumed later. Some questions refer to diagrams. The diagrams for the selected question pool are displayed in a separate window using eog(1). Licenses are issued by the Federal Communications Commission (FCC), but examinations are administered by Volunteer Examiners. OPTIONS
If no pool is specified, usage, version, and help information is displayed. In normal usage, one of the following options should be specified: t Element 2, the Technician Class pool. This is the entry-level license. g Element 3, the General Class pool (element 2 is also required). e Element 4, the Extra Class pool (elements 2 and 3 are also required). q The question pool is selected interactively. FILES
A directory ~/.hamexam is created to hold the names of the questions which remain to be answered correctly. SEE ALSO
For more information regarding licensing, ref. http://www.arrl.org/licensing-preparation-exams For information regarding the question pools, ref. http://www.ncvec.org/ COPYRIGHT
hamexam is Copyright (c) 2011-2012 John Nogatch <jnogatch@yahoo.com>. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. BUGS
The question pools are normally good for 4 years, but are sometimes modified; ref. http://www.ncvec.org/ hamexam does not automatically update the question pools from the VEC Web site. HAMEXAM(1)
All times are GMT -4. The time now is 08:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy