[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] Finde .bashrc



Kristian Vilmann wrote:
... skip ...

Ja. locate er er ret til nogle ting. Og meget hurtigere end find. Til gengæld finder den revl og krat.


Det er rigtigt, den finder det hele og lidt til. Argumentet til locate er en tekststreng, og locate finder alle filer, som har den streng i navnet. Men man kan jo pipe til less, så det hele ikke ryger ovenud af vinduet.
Søgningen kan også gøres mere specifik ved at pipe til grep.
F.eks. vil 'locate locate' finde denne fil:
/usr/share/webmin/postfix/help/relocated.html og en masse andet uvedkommende.
'locate locate | grep bin' finder:
/usr/bin/locate
/usr/bin/dislocate
/usr/bin/slocate


Men find har nu altså også sin berretigelse. Et, måske ikke særlig realistisk, eksempel:
locate xmms giver 143 linier. Men hvis det nu bare vare den binære xmms jeg ville finde:
find / -name xmms -perm 755 -type f 2>/dev/null


find er min yndlingskommando. Den kan alt mulig sjovt. Det kan klart betale sig at læse manualsiden i gennem, så man har en ide om mulighederne.

Javist har find sin berettigelse, fordi find kan udføre operationer på filerne, som f.eks. ændre permissions, slette filerne osv.
Men når det blot drejer sig om at lokalisere filer foretrækker jeg locate.




--
Med venlig hilsen

Jørgen Heesche
mailto:sslug@sslug
Registered Linux User #401007


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2006-01-01, 02:03 CET [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] *