LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-19-2004, 08:10 PM   #1
ultima
LQ Newbie
 
Registered: May 2004
Location: australia
Posts: 1

Rep: Reputation: 0
Unhappy find command...


I'm quite new to Linux and i need help with writing a script for finding a file. It should only takes 2 arguments, the first is the filename to be search and the second is the directory to start searching from. This is to be done using the find command. Any help would be appreciated. Thanks in advance.
 
Old 05-20-2004, 02:24 AM   #2
Qucho
Member
 
Registered: Mar 2004
Location: Colorado, US
Distribution: Debian "Sarge"
Posts: 228

Rep: Reputation: 30
Here is a totoruial, I have not finished it but so far i find it very useful.
http://www.freeos.com/guides/lsst/index.html

And for your project, I am sure you will find your solutions on it.

Luck,
 
Old 05-20-2004, 04:28 AM   #3
linuxzouk
Member
 
Registered: Apr 2004
Location: Malaysia
Distribution: Fedora Core
Posts: 93

Rep: Reputation: 15
hmm, try your luck with...

find directory -iname "file-name" -print

eg.
find /etc -iname "smb.conf" -print

i have long not do scripting (since college) but i think u can pass in the arguments something to do with $1 $2

myfindscript file-name directory-name
$1 is for file-name
$2 is for directory-name

<content of myfindscript>
find $2 -iname $1 -print
#if it doesn't work try
#find $2 -iname "$1" -print

eg.
#myfindscript /etc smb.conf

i haven tested it though... correct me if i'm wrong

Last edited by linuxzouk; 05-20-2004 at 04:34 AM.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Find/grep command to find matching files, print filename, then print matching content stefanlasiewski Programming 9 06-30-2016 05:30 PM
find command jch02140 Linux - Newbie 2 07-19-2005 12:21 AM
The find command Gins Linux - General 32 06-12-2005 02:20 PM
What is the FIND command Mic Q SUSE / openSUSE 1 04-07-2005 09:08 AM
not find mt command imsajjadali Red Hat 2 02-07-2004 06:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration