LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Other *NIX
User Name
Password
Other *NIX This forum is for the discussion of any UNIX platform that does not have its own forum. Examples would include HP-UX, IRIX, Darwin, Tru64 and OS X.

Notices

Reply
 
Search this Thread
Old 01-06-2014, 06:37 PM   #1
arfon
Member
 
Registered: Apr 2004
Location: Texas - Dang, it's hot!
Distribution: Slackware, Slackware64, Slax, CentOS (when I have to)
Posts: 132

Rep: Reputation: Disabled
HPUX: find command finding non-existent files


When I:
Code:
     find /home -type f | xargs ls -l | sort -k5 | head
I get:
Code:
     /home/bob/UC.T.DATA not found
     /home/chug/IERT.txt not found
     flemdata not found
1) Why is find finding non-existent files?

2) I added | grep -v "not found" to the command with no effect, why?
 
Old 01-07-2014, 01:47 AM   #2
rhoekstra
Member
 
Registered: Aug 2004
Location: The Netherlands
Distribution: RedHat 2, 3, 4, 5, Fedora, SuSE, Gentoo
Posts: 354

Rep: Reputation: 40
To start with 2, probably the error 'not found' is sent to STDERR, not STDOUT. you should redirect the error to STOUT in order to filter it with grep.

that said, do the files actually exist? and if so, don't they contain 'weird' characters or spaces?
 
1 members found this post helpful.
Old 01-07-2014, 02:06 AM   #3
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,446
Blog Entries: 11

Rep: Reputation: 182Reputation: 182
Could as well be a race condition. I have no idea about the interna of file but I guess that it gets a directory listing and then lists the file of it. But if there beeing enough time between getting the listing of the directory and listing the actual file the file might all ready be deleted. Thus not found.
 
1 members found this post helpful.
Old 01-07-2014, 06:19 AM   #4
rhoekstra
Member
 
Registered: Aug 2004
Location: The Netherlands
Distribution: RedHat 2, 3, 4, 5, Fedora, SuSE, Gentoo
Posts: 354

Rep: Reputation: 40
How about this command:

Code:
find /home -type f -exec ls -l {} \; | sort -k5 | head
 
1 members found this post helpful.
Old 01-07-2014, 04:31 PM   #5
arfon
Member
 
Registered: Apr 2004
Location: Texas - Dang, it's hot!
Distribution: Slackware, Slackware64, Slax, CentOS (when I have to)
Posts: 132

Original Poster
Rep: Reputation: Disabled
The files definitely do not exist.

Redirecting stderr had no affect.

find /home -type f -exec ls -l {} \; | sort -k5 | head - just sits there and I had to CTRL-C out of it...

I'll just write the output to a text file then parse the file...


MY CONCLUSION: HPUX is a POS.

Thanks for the help though.

Last edited by arfon; 01-07-2014 at 04:35 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Find top 100 files in HPUX fanatic_ravi Other *NIX 1 06-03-2013 08:54 AM
[SOLVED] The find command not actually finding some files. bluesword1969 Linux - General 5 09-28-2010 10:34 AM
Finding my CD-ROM device by find command? kushalkoolwal Linux - Software 0 08-20-2009 02:32 PM
find command : finding files that are created within last 24 hours Fond_of_Opensource Linux - Newbie 1 11-06-2006 03:47 AM
How find which command has been executed by which user. HPUX 11.11 OS kshell murugesan Linux - Distributions 3 04-16-2004 05:26 AM


All times are GMT -5. The time now is 05:19 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration