xargs undesired behaviour.
Kernel 2.6.21.5, GNU (Slackware 12.0).
find 4.2.31 xargs 4.2.31 ls 6.9 bash 3.1.17 Hi: Code:
find . -name *.htm* -print0|xargs -0 ls Clearly, '*.htm*' can't be matched by 'f2'. In the dir I'm running the command in, find does not find any matching file. In turn, then, xargs delivers 0 arguments to ls which makes ls to output the whole directory listing. But the intended command purpose I think is evident. I only need to rule out the particular case just described. Any suggestions? Regards. |
what exactly are you trying to do? I am sure you are not just printing the listing out right?
if that's the case, the -ls switch will do Code:
find . -iname "*htm" -ls |
Thanks for your reply. I think this will describe it:
Quote:
|
Code:
find . -printf "%TH%TM%TS:%p\n" | sort -n | tail -5 |
Yes. After receiving post #2 I limited myself to describe the scenario but I did not do any thinking. But after sending #3 I saw find was enough to do the main job. Now I'll play a little under the guidelines given by you. Thanks a lot.
|
Quote:
|
Thank you very much. Regards.
|
All times are GMT -5. The time now is 05:12 AM. |