LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-22-2008, 04:03 PM   #1
tostay2003
Member
 
Registered: Jun 2006
Posts: 126

Rep: Reputation: 15
find with UVfile


Hi,

I am trying to find a file and execute command UVfile on it, using the below command (currently on root directory)

Code:
 find . -exec UVfile {} \;
I thought that find traverses in sub-directories as well. But the above statment is just checking in the root directory and not the sub-directories. I tried the man find. But didn't find any option which says traverse through sub-directories.

Did I miss anything.
 
Old 07-22-2008, 04:28 PM   #2
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
find does search sub-directories unless you prevent it with the option "-maxdepth 1".

There are a couple of possibilities why this might not be happening:
  • maybe there are no sub-directories in the working directory when you execute the command. You specified "." as the root of the search. If you want the root directory on the whole filesystem, do:
    Code:
    find / -exec UVfile {} \;
  • find might be aliased to something else. If you are using bash as your shell, the command:
    Code:
    type find
    will tell you exactly what find is.
  • find does not follow symbolic links by default. If all the sub-directories are actually symlinks, use the -follow option.
  • Unless you want to pass all directories too, you should specify that you only want files, like this
    Code:
    find / -type f -exec UVfile {} \;
 
  


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
linux find to find files with multiple patterns subu_s Programming 6 12-15-2010 12:15 AM
Find with -exec argument - not giving proper output..how to find... hinetvenkat Linux - Server 4 01-25-2010 06:19 AM
Can`t find C-compiler in Debian ,or at least can`t find one that can make executables hemmelig Linux - Software 4 05-26-2008 03:07 AM
Is there a way to find recently created/edited files without using find? BrianK Linux - General 2 10-15-2007 09:41 PM
I cannot find what should be very easy to find... a distro with the Gnome desktop bluecog6 Linux - General 3 06-10-2007 07:31 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:05 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