Subscribe to RSS Feed

terminal-logo-smallThis is quick guide howto find files and directories quick and efficiently on Linux with locate command. Linux find command is outdated, slow and complicated to use, so locate command is much better option.

Locate basic usage find files and directories

locate file
# example
locate httpd.conf
 
locate path
# example
locate /X11/

Find (locate) ignore-case (not case sensitive)

locate -i file
# example
locate -i netbeans

Find (locate) only file name (basename)

locate -b file
# example
locate -b shadow

Limit locate output

locate -l 100 file
# example
locate -l 50 conf

Print number of found entries

locate -c file
# example
locate -c conf

Print number of found entries

locate -c file
# example
locate -c conf

Print locate statistics

locate -S

Print number of found entries

locate -c file
# example
locate -c conf

Find (locate) with full file info

Simply locate something and pipe output to ls command.

locate file |xargs ls -lah

Want to know even more

Check help and manual

locate --help
man locate

Bookmark & Share

Wondering what to do next?

Grab My Feed

Subscribe to RSS Feed

Catch Me On Twitter

Catch Me On Twitter!

Sponsors


Leave a Reply

Recent Comments