- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: find command giving unexpected output
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
Forums
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
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
10-18-2007 10:31 PM
10-18-2007 10:31 PM
I am runnig the following command
find / -xdev -size +100000c -exec ls -lt {} \; | more
The output of this command gives me files and directories of /, /tmp & /home
The files from /tmp and /home are not expected in this output.
Am i missing something over here. ???
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2007 10:55 PM
10-18-2007 10:55 PM
Re: find command giving unexpected output
Just to be sure :-) /tmp and /home are not part of / root filesystem?
Could you post your HPUX version.
Regards,
Robert-Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2007 11:14 PM
10-18-2007 11:14 PM
Re: find command giving unexpected output
It seems as though /tmp and /home are subdirectories of /.
Run this command:
$ bdf / /tmp /home
and see if the filesystem is the same for each.
PCS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2007 11:21 PM
10-18-2007 11:21 PM
Re: find command giving unexpected output
# bdf / /tmp
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 212992 197577 14464 93% /
/dev/vg00/lvol5 1048576 39086 949004 4% /tmp
/ , /tmp & /home are all different file systems...
Still the find command shows files from those directories.
# uname -a
HP-UX XXXXXXXX B.11.11 U 9000/800 1772297399 unlimited-user license
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2007 11:48 PM
10-18-2007 11:48 PM
Re: find command giving unexpected output
http://www4.itrc.hp.com/service/patch/patchDetail.do?patchid=PHCO_36502&sel={hpux:11.11,}&BC=main|search|
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2007 12:40 AM
10-19-2007 12:40 AM
Re: find command giving unexpected output
you should specify plain files only, e.g.:
# find / -type f -xdev -size +100000c -exec ls -lt {} \; | more
if you do not, your find command will also include directories and the ones mentioned are probably the ones on your system which are above the size specified and thus included for ls.
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2007 12:49 AM
10-19-2007 12:49 AM
Re: find command giving unexpected output
I got your point. However if i am including the filter -xdev it should ideally not consider /tmp and /home directories as they are under different mount point.
Am i right???
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2007 12:56 AM
10-19-2007 12:56 AM
Re: find command giving unexpected output
Thanks John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2007 12:57 AM
10-19-2007 12:57 AM
Solutionall mount points are in the root or / filesystem, i.e. they are there as (directory)files of a certain size.
Apparently /home and /tmp have a size that meets your reuirement and are therefore they "victims" of the ls command.
Thus your find command does not cross mount points, but you did not get what you wanted.
Try changing the size and you may see the effect of ls on other mount points.
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2007 01:04 AM
10-19-2007 01:04 AM
Re: find command giving unexpected output
I observed the change in output. U r right.
So will the patch mentioned by Robert in previous post take care of this..
i mean do not victimise the other directories
or the only solution to this is to make sure i use -type filter.
Sunny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2007 01:40 AM
10-19-2007 01:40 AM
Re: find command giving unexpected output
John's use of '-xdev' is correct and the 'find' patch mentioned isn't going to change the behavior you observer whether or not it is installed.
The manpages for 'find' clearly note tat '-dev' ...causes find to avoid crossing any file system mount points that exist below starting points enumerated in pathname_list."
Thus if you want to confine your search to the '/' mountpoint (and thus directories like '/etc/ and '/sbin' which are not mountpoints), use 'find / -xdev ...'.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2007 01:53 AM
10-19-2007 01:53 AM
Re: find command giving unexpected output
Thanks to all
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2007 01:54 AM
10-19-2007 01:54 AM
Re: find command giving unexpected output
your original command does not cross any mountpoints - this is important to notice.
But your original command does not distinguish between different types of files; and directories are also files, among other things they have a certain size.
Your original command includes files of any type in the root directory that are bigger than the specified size.
It is just a coincidence that the two directories /tmp and /home are also mountpoints, and your find command makes thus "ls -lt /tmp" and "ls -lt /home".
You could actually have directories in the root file system bigger than the specified size, and your find would also "ls -lt" them.
You should notice that you get the output of "ls -lt /tmp" and "ls -lt /home" but the files listed by that operation are not necessaricily as big as the size specified.
regards,
John K.