[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [NOVICE] Unix search



Niels Larsen wrote:
tror at jeg kaster

mig over find kommandoen.

************************
*smiler*
Det bliver du snart træt af, og går så over til locate (sansynligvis??)
Find søger nemlig gennem alle dir og filer hver gang, medens locate søger i sin database, som et mindre lyn

Altså... det drejer sig jo om at bruge det rigtige værktøj.


locate er mægtig god

sslug@sslug:~ $ locate smb.conf
/usr/share/man/man5/smb.conf.5.gz
/usr/share/samba/smb.conf
/usr/lib/vmware/configurator/vmnet-smb.conf
/etc/samba/smb.conf
sslug@sslug:~ $

Ret brugbart.

Men hvad nu hvis det er apache vi skal finde noget om? Så er locate ikke særlig anvendelig:

sslug@sslug:~ # locate apache|wc -l
508
sslug@sslug:~ #

508 linier. Der i blandt linier som
/home/kvi/work/kunder/JV/ged/explorer.80e1dcc6.jvcci3-2005.03.25.10.27/init/rc0.d/K16apache
og
/usr/share/icons/hicolor/48x48/apps/apacheconf.png

og meget mere af den slags.

Vi ved at konfigurationsfiler ligger under /etc på en linuxmaskine:
sslug@sslug:~ # find /etc -name apache\*
/etc/default/apache2
/etc/init.d/apache2
/etc/logrotate.d/apache2
/etc/apache2
/etc/apache2/apache2.conf
sslug@sslug:~ #

Det er da absolut brugbart. Få lige locate til at gøre det :)

locate apache | grep '/etc'|wc -l giver 70 liniers output.

Morale: locate er hurtig. find er mere præcis.
I begge tilfælde bliver man nødt til at vide en smule om hvad man søger efter.


/kristian

 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 21:21 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *