566 tutoriels disponibles
Chercher un tutoriel
Bienvenue
sur Shareannonce
 
Enable ‘locate’ Command in the Mac OS X Terminal
Ecrit par: Shareannonce
Date création:  03-11-2011
Nombre de vues:  2453
Catégorie:  informatique > apple > logiciel > lion
Note: 
 
   Tutoriel N° 1c9

Enable ‘locate’ Command in the Mac OS X Terminal


if you don’t have locate enabled yet all that is required is typing this command into the Terminal:

sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist


This is told to you directly by OS X the first time you attempt to run locate or any of the commands dependent on the database:



How long it takes to generate the database varies, but the larger your hard disk the longer it’ll be. You can watch the progress indirectly through Activity Monitor, where the “find” process will be running at around 15-30% CPU use until the locate database is generated.



Alternatively you can also run the following command and build the database:

sudo /usr/libexec/locate.updatedb


As with many terminal commands, locate accepts wildcards and regular expressions, helping you narrow down advanced searches. For example, you could find every possible file with a .jpg extension by using:

locate *.plist




Some jpg files will inevitably have an uppercase extension though, and you can tell locate to ignore case sensitivity with -i:

locate -i *.jpg




 
 
   Autres tutoriels de la même catégorie >
 
ShareAnnonce version 2.0 Tous droits reserves. | Condition d'utilisation | Contact