NetworkClue.com
NetworkClue Home PageHome Contact UsContact ConsultingConsult
Bulletin Board
Internet Services covers Secrets to hosting websites, Hosting your own web server, and using DNS Servers.Operating Systems leads you through the decision of Linux vs. Windows, ideal installations and setups to create an efficient and redundant environment for your business, and great features to make management easier.Routing & Firewalls contains articles that will allow you to take control of your router. Learn how to protect your company with access lists and advanced firewall techniques.Hardware answers the common questions about Switches vs. Hubs, recommends SysAdmin Tools, and recommendations for adequate power protection.Utilities will cover fighting spam, using Anti-Virus programs effectively and the must haves for every administrator's software toolbox.

Bulletin Board

Using Find - the File Search Tool

By Joshua Erdman
Digital Foundation, inc.

This page contains a description of how to search for files based on file name and age.  The output can then be directed to a text file, the terminal screen, or a program.

Command Syntax

find [path...] [expression]

Find will recursively search starting at the path you specify for files with a given name (using the -name flag) or days last modified (using the -mtime flag). There are plenty of other ways to filter through files so be sure to look through the man pages.

 

Examples

Example: In this example we search through all files starting from the root looking for a file with the name sendmail.cf  If the file is found, the file and path will be printed to the screen.

    find / -name sendmail.cf -print

Example: In this case, no file is specified.  We are searching in the current directory for all files that have been last modified 10 days ago or older.  The output is then sent to the rm command to delete these files.

   find . -mtime +10 -exec rm '{}' \;

Article last reviewed: 10/25/2006


del.icio.us

Created by: Digital Foundation, inc.

Copyright © 2002-2005 Digital Foundation, inc.   www.networkclue.com

All content of the NetworkClue website is copyrighted. Articles, notes, outlines, and all other materials may not be stored on the Internet or sold or placed by themselves or with other material in any electronic or printed format in whole or part. However materials may be referenced by links to the site.

 

Related Articles:
Linux
Windows vs. Linux

 

Advertise Here