How to Find a file by name in UNIX/Solaris/Linux?

How to Find a file by name in UNIX/Solaris/Linux?, 9.5 out of 10 based on 2 ratings
VN:F [1.9.7_1111]
Rating: 9.5/10 (2 votes cast)

To find a file in UNIX, Solaris, or Linux,  you can use the ‘Find‘ command.

Exampel: find / -name apache.* -print

This will search the whole system for any filename with apache and print the output to the screen.

Other arguments for the Find command:

-user username   <– this will search files owned by an user
-group groupname  <– this will search files owned by a group
-name filename  <– this will search files with matching filename
-print <– this will list out the output
-exec  command {} \;<– this will use the located files as arguments to a command.
-type x <– this will search by file type [ f (ordinary file), d (directory), b (block special file), c (character special file), D (door), l (symbolic link), p (named pipe), or s (socket) ]

Related Tech posts:

  1. Linux Server for ISPs and Hosters, What should be in it?
  2. Linux Root Password
  3. How to check the port speed and duplex setting?
  4. Solaris : How to reset root password
  5. vmdb failure unable to open snapshot file

About the Author