Linux: How can I find a file on my system?

by Vivek Gite [Last updated: December 27, 2006]

Q. I have remove server. I login through SSH program. How do I find a file called xyz on my Linux server system?

A. You can use find command. It search for files in a directory hierarchy under Linux and all other UNIX like oses. Use find command to find a file from shell prompt.

Find command syntax

find Search-Directory-Path -name file-name-to-search

Examples

To find a file called zyz in /home/user directory type the command:
$ find /home/user -name xyz

To find a file called passwd in / (search entire system) directory type the command:
$ find / -name passwd

See this previous article for more info.

Want to read Linux tips and tricks, but don't have time to check our blog everyday? Subscribe to our daily email newsletter to make sure you don't miss a single tip/tricks. Subscribe to our weekly newsletter here!

{ 0 comments… add one now }

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Previous post: List the contents of a tar or tar.gz file

Next post: How to: Linux or UNIX List just directories or directory names