Question about Restricting Search path of FIND to current directory


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Question about Restricting Search path of FIND to current directory
# 1  
Old 10-17-2005
Question Question about Restricting Search path of FIND to current directory

Hi,

By default FIND command searches for matching files in all the subdirectories within the specified path.

Is there a way to restrict FIND command's search path to only the specified directory and NOT TO scan its subdirectories.

Any help would be more than appreciated.
Thanks and Regards
# 2  
Old 10-17-2005
Welcome to the forum.

Here are the rules which says

(5) Search the forums database with your keywords before asking.

And here is the advanced tutorial on find - advanced/complex uses of the find command
# 3  
Old 10-17-2005
Sorry for the same

Hi,

My requirement was so urgent that I forgot to search the forum and posted the issue st away.

My apologies. Will not repeat the same again.

Thanks
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Search: find current line, then search back

Hello. I want to find a line that has "new = 0" in it, then search back based on field $4 () in the current line, and find the first line that has field $4 and "last fetch" Grep or Awk preferred. Here is what the data looks like: 2013-12-12 12:10:30,117 TRACE last fetch: Thu Dec 12... (7 Replies)
Discussion started by: JimBurns
7 Replies

2. UNIX for Dummies Questions & Answers

How to get the current directory Path?

How to get the current directory Path in your prompt? i am getting a $ mark only in my prompt? Please help me with this (3 Replies)
Discussion started by: Abhishek0683
3 Replies

3. Shell Programming and Scripting

How to restrict Find only search the current directory?

hello, all I have googled internet, read the man page of Find, searched this forum, but still could not figure out how. My current directory is: little@wenwen:~$ pwd /home/little little@wenwen:~$ I want to use find command to list the files in my current directory, how should i write... (3 Replies)
Discussion started by: littlewenwen
3 Replies

4. UNIX for Dummies Questions & Answers

Restricting a Find search to the current directory only

Hi All, I am trying to delete file (with a mtime older than 2 days) from the current directory ONLY using: find . -daystart -maxdepth 1 -mtime 2 -exec rm {} \; but this doesn't seem to work it is still find files in subdirectories which I don't want to delete. Please can anyone offer... (2 Replies)
Discussion started by: daveu7
2 Replies

5. UNIX for Dummies Questions & Answers

Setting the current directory path to terminal title

In ubuntu, I want to update the title of the terminal window with the current directory path. Any ideas how this can be achieved? ---------- Post updated at 02:22 PM ---------- Previous update was at 02:08 PM ---------- Done it ---------- Post updated at 02:30 PM ---------- Previous update... (2 Replies)
Discussion started by: kristinu
2 Replies

6. Shell Programming and Scripting

"find . -printf" without prepended "." path? Getting path to current working directory?

If I enter (simplified): find . -printf "%p\n" then all files in the output are prepended by a "." like ./local/share/test23.log How can achieve that a.) the leading "./" is omitted and/or b.) the full path to the current directory is inserted (enclosed by brackets and a blank)... (1 Reply)
Discussion started by: pstein
1 Replies

7. Shell Programming and Scripting

Restricting zip to current directory only

I am using the following command in a C shell script: find . -name "*.*" -print | zip $ProjectZipFile -@ to zip files in a Unix (Sun and/or Linux) directory for archiving purposes. This command works fine, the only problem being that if sub-directories are present, they are included in... (5 Replies)
Discussion started by: phudgens
5 Replies

8. Shell Programming and Scripting

non recursive search in the current directory only

Hi, Am trying for a script which should delete more than 15 days older files in my current directory.Am using the below piece of code: "find /tmp -type f -name "pattern" -mtime +15 -exec /usr/bin/ls -altr {} \;" "find /tmp -type f -name "pattern" -mtime +15 -exec /usr/bin/rm -f {} \;" ... (9 Replies)
Discussion started by: puppala
9 Replies

9. UNIX for Dummies Questions & Answers

Restrict my search to current directory.

Hi every1, There is a folder with .lst files which has email id's of our project group. I want to find files which has my email id starting with sachin but i dont want find command to search subdirectories. I have read about prune but i didnt understand that. I am pretty new in this field.... (7 Replies)
Discussion started by: sachin.gangadha
7 Replies

10. Shell Programming and Scripting

want the current directory without the absolute path

Hi guys I'm trying to move an empty directory to the $TRASH directory. Say the directory i have is ./hello/hello1/hello2 and i'm in hello2, and i want hello2 moved. this code: TRASH=$home/deleted find "$TRASH/$1" -type d -exec rmdir { } \; 2>/dev/null mv -f $1 $TRASH 2>/dev/null works... (2 Replies)
Discussion started by: olimiles
2 Replies
Login or Register to Ask a Question