- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- command "find" -Option: -xdev / option perl File...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2011 12:48 AM
07-06-2011 12:48 AM
hello,
unix command find has following option:
find
-- Option: -xdev
or
-- Option: -mount
Don't descend directories on other filesystems. These options are
synonyms.
we have a perl program and i can't find a Option , which do the same like "-xdev"
use File::Find;
.....
# process is a procedure
find({wanted => \&process,no_chdir => TRUE},$file_system);
i didn't find a option . does a option exist ?
regards
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2011 01:46 AM
07-06-2011 01:46 AM
Re: command "find" -Option: -xdev / option perl File::Find
>Option: -mount
There is no such option. There are -xdev and -mountstop.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2011 05:07 AM
07-06-2011 05:07 AM
Re: command "find" -Option: -xdev / option perl File::Find
Try the "find2perl" command with the options that you want to use.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2011 06:19 AM
07-06-2011 06:19 AM
Re: command "find" -Option: -xdev / option perl File::Find
Hi:
As Tom suggested, leverage 'find2perl' to see how this can be done. If you compare something like:
# find2perl /etc -print
...with:
# find2perl /etc -xdev -print
...you can see that the key is evaluating the stat() structure's device number. The 'File::Find::topdev' variable holds the top directory's device number and find() skips objects that don't have the same device number.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2011 10:14 AM
08-10-2011 10:14 AM
Re: command "find" -Option: -xdev / option perl File::Find
hello,
i tried find2perl , but how i use i the perl script of author
"A. Clay Stephenson" How to find the greatest size file in certain mount point? ( it is in the attachment), also in the attachment "find2perl "
regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2011 10:35 AM
08-10-2011 10:35 AM
Solution
@support_billa wrote:i tried find2perl , but how i use i the perl script of author
"A. Clay Stephenson" How to find the greatest size file in certain mount point? ( it is in the attachment), also in the attachment "find2perl "
The suggestion for looking at 'find2perl' was to show how you implement the shell's find()'s '-xdev' option. As I originally saidt the key is evaluating the stat() structure's device number. The 'File::Find::topdev' variable holds the top directory's device number and find() skips objects that don't have the same device number.
You can modify Clay's script to include this if that meets your need; or write your own (to do what *you* want to do; or *not* use File::Find but rather use 'readdir()' to recursively descend a directory and examine and "do things" with its contents.
I would be appropriate if you provided some thanks and some feedback in the form of kudos for the help you have received in numerous threads, too.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2011 01:49 AM
08-11-2011 01:49 AM
Re: command "find" -Option: -xdev / option perl File::Find
hello,
thank you for your help, i try to change the perl code .
regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2011 07:35 AM
08-25-2011 07:35 AM
Re: command "find" -Option: -xdev / option perl File::Find
with help i changed the perl code . it contains an new optional parameter "-xdev".
it works well , but a little bit slow for filesystem "/" , ux-command "find" is faster !
regards