command: locate
usage: find files by name

synopsis: locate [OPTION]... PATTERN...

examples:

1. To print the options and info of this command

    $ locate --help

2. To search a particular file lftp.conf

    $ locate lftp.conf

3. To display all the output in one line

    $ locate -0 sysctl.conf

4. To get the count of number of matching entry

    $ locate -c sysctl.conf

5. To display only the files that exists in the system

    $ locate -e sysctl.conf

6. To make the results case insensitive

    create two empty files

    # touch sample.txt SAMPLE.txt

    # updatedb

    only root user can do updatedb

    $ locate sample.txt

    will only show sample.txt

    with -i option

    $ locate -i sample.txt

    will show both sample.txt and SAMPLE.txt

7.  To display only certain number of records

     $ locate -l 5 passwd

     $ locate -l 10 passwd

8. To display locate statistics

     $ locate -S


regards,
dhanasekar
_______________________________________________
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc
ILUGC Mailing List Guidelines:
http://ilugc.in/mailinglist-guidelines

Reply via email to