Confused with find


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Confused with find
# 1  
Old 02-05-2011
Confused with find

Hi ,I am reading and trying examples with find ,but I am little bit confused,
How can I search only in sertain directory,Could you give me some example
Thanks a lot
find . -size +10k
find . -name "name"
# 2  
Old 02-05-2011
You can ask `find' to search in any directory you want

Code:
find . /tmp $HOME -name foo

Look for the file foo in current directory, in /tmp and in $HOME
# 3  
Old 02-05-2011
The period after find just means "in the current working directory". You can specify whatever directory to find in such as
Code:
find /var/mobile/test -type f -name *.log

which looks in /var/mobile/test for files ending in .log. Find is pretty easy.
# 4  
Old 02-05-2011
Try this:
Code:
find ./ -name "*name*" -size +'10k'

# you can't have two (2) PATHS in your find query, i.e. [ . /tmp ] which is 'space' delimited to the current directory [.] and the [/tmp] directory.
# 5  
Old 02-06-2011
Quote:
Originally Posted by AlphaLexman
you can't have two (2) PATHS in your find query
Yes you can. Or nine, even. There's no limit except ARG_MAX on your system.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Not able to find the perfect code...Geting confused in between

I have to find last delimiter in each line of a file and store the value after the last '/' in a variable in ksh script...Pls Pls help me:(The file is as shown below: /opt/apps/cobqa/apps/abadv/bind/advc0007.bnd /opt/apps/cobqa/apps/abbrio/bind/naac6115.bnd... (5 Replies)
Discussion started by: bhavanabahety
5 Replies

2. Shell Programming and Scripting

Find + Symlinks = me confused

So i have read the man pages a few time. Searched google but I am not quite sure i understand all the lingo. What i want to do is list all files on / except i dont want any symlinks (because if I am searching / I will find the "true" file...correct?) So there is the -P, -H, and '-type l'... (2 Replies)
Discussion started by: nitrobass24
2 Replies

3. Shell Programming and Scripting

Confused with if/then

Hi All, I'm pretty new to this so please bear with me... I'm trying to write a bash script to first search in a file for a string of characters; if the characters exist than skip the rest of the code until you get to the last line and run that command /sbdin/ldconfig; if the string doesn't... (2 Replies)
Discussion started by: gmdune
2 Replies

4. Ubuntu

New and Confused

Hello, I am having a problem with Dual Booting Windows XP Pro and Linux Mint. I have Three Hard Drives, One Hard Drive has Linux Mint Loaded on it. When it is hooked up to the computer by itself it works great. This is an IDE Drive. The Second Hard Drive has Window XP Pro loaded on it.... (3 Replies)
Discussion started by: Forextrading
3 Replies

5. Solaris

Confused c#t#d#s#

I am confused c#t#d#s# once I learn the following : slice 0 ...... 0 to 2520 slice 1....... 2521 to 2840 slice 6........2841 to 8891 slice 2........0 to 8891 really really confused. Please explain. (8 Replies)
Discussion started by: deltakutty
8 Replies

6. UNIX for Dummies Questions & Answers

confused

A red hat linux ftp server exists in which a file exists. My problem is I need to connect to this server from my windows xp terminal which is in the same network & retrieve the file then convert it to xcel for some data Pls advs commands and procedure to connect to the machine...oh my god... (1 Reply)
Discussion started by: sauravjung
1 Replies

7. Shell Programming and Scripting

confused with cp

may i know what cp $1 $2 $0 $2 does? (12 Replies)
Discussion started by: C|[anti-trust]
12 Replies

8. UNIX for Dummies Questions & Answers

confused

hi! how when i'm chattin inside com there was this chatter andi don't know what he did but he saw all my files inside my shell. what did he do? (4 Replies)
Discussion started by: hapiworm
4 Replies

9. UNIX for Dummies Questions & Answers

confused,,,,

Hi,,, is there any possibility to install Linux in my P.C which is use Win98 without loose anything from my hard disk???? ---------------------------------------------------------------------------------- Is it better for a newbie in this kind of OS to install Linux instead of... (5 Replies)
Discussion started by: spyros
5 Replies
Login or Register to Ask a Question