find behavior

2013-02-09 Thread pascal
bonjour
sous  FEDORA 18 3.5.7 204  Gnome Version 3.6.2 
find return le répertoire de recherche par défaut 
exemple find /home/pascal/usbfree/cam/
/home/pascal/usbfree/cam/
/home/pascal/usbfree/cam/00D6FB009109()_1_20130209110708_147040.jpg
/home/pascal/usbfree/cam/00D6FB009109()_1_20130209110710_147041.jpg
/home/pascal/usbfree/cam/00D6FB009109()_1_20130209110711_147042.jpg

danger dans l'utilisation 
find /home/pascal/usbfree/cam/ -ctime $1 -exec mv
{} /home/pascal/usbfree/$avant/ \;

cordialement

hello
3.5.7 in Fedora 18 Gnome 204 Version 3.6.2
find return the default search directory
example find / home / pascal / usbfree / cam /
/ home / pascal / usbfree / cam /
/ home/pascal/usbfree/cam/00D6FB009109 () _1_20130209110708_147040.jpg
/ home/pascal/usbfree/cam/00D6FB009109 () _1_20130209110710_147041.jpg
/ home/pascal/usbfree/cam/00D6FB009109 () _1_20130209110711_147042.jpg

danger in the use
find / home / pascal / usbfree / cam /-ctime $ 1-exec mv {} / home /
pascal / usbfree / $ forward / \;

cordially




link

2016-07-22 Thread Pascal
hi,

how find links and exec command on pointed files ?

$ touch a
$ ln -s a b
$ ll
a
b -> a
$ find -H . -type l -exec md5sum '{}' \;
d41d8cd98f00b204e9800998ecf8427e  ./b

md5sum is running on "./b" and not on "./a" like excepted :-(

regards


Re: link

2016-07-23 Thread Pascal
I think I misled on "*except while processing the command line argument*"
for the -H option, wich is for find and not for exec command :-(
after some internet research, I tried this :

find . -type l -exec sh -c "md5sum \$( readlink {} )" \;
d41d8cd98f00b204e9800998ecf8427e  a

and it seems ok for me :-)

regards

2016-07-23 9:57 GMT+02:00 Pascal :

> hi,
>
> if I understand the man of find :
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *   -H Do  not  follow symbolic links, except while processing the
> com‐  mand line arguments.  When find examines or  prints
> information  about  files, the information used shall be taken
> from the prop‐  erties of the symbolic link itself.   The only
> exception to this  behaviour is when a file specified on the
> command line is a sym‐  bolic link, and the link can be
> resolved.  For  that  situation,  the  information  used is
> taken from whatever the link points to  (that is, the link is
> followed).  The information about the link  itself  is used as
> a fallback if the file pointed to by the sym‐  bolic link
> cannot be examined.  If -H is in effect  and  one  of  the
> paths specified on the command line is a symbolic link to a
> directory, the contents  of  that  directory  will  be
> examined  (though of course -maxdepth 0 would prevent this).*
> exec command should be played on "./a" and not "./b" ?
>
> 2016-07-22 20:40 GMT+02:00 Dale R. Worley :
>
>> Pascal  writes:
>> > how find links and exec command on pointed files ?
>> >
>> > $ touch a
>> > $ ln -s a b
>> > $ ll
>> > a
>> > b -> a
>> > $ find -H . -type l -exec md5sum '{}' \;
>> > d41d8cd98f00b204e9800998ecf8427e  ./b
>> >
>> > md5sum is running on "./b" and not on "./a" like excepted :-(
>>
>> But that is the behavior expected running md5sum on "./b"!
>>
>> $ touch a
>> $ ln -s a b
>> $ ll
>> total 248
>> drwxr-xr-x.  2 worley worley   4096 Jul 22 14:37 .
>> drwxr-xr-x. 53 worley worley 245760 Jul 22 14:37 ..
>> -rw-r--r--.  1 worley worley  0 Jul 22 14:37 a
>> lrwxrwxrwx.  1 worley worley  1 Jul 22 14:37 b -> a
>> $ find -H . -type l -exec md5sum '{}' \;
>> d41d8cd98f00b204e9800998ecf8427e  ./b
>> $ find -H . -type l -exec echo md5sum '{}' \;
>> md5sum ./b
>> $ md5sum ./b
>> d41d8cd98f00b204e9800998ecf8427e  ./b
>> $
>>
>> Dale
>>
>
>