FIND - locate files and directories

find ./ -name "layout.*"
find all files or directories named layout.[something], recursively under the current directory.

find /home -type f -name "*.inc"
find only files named [something].inc in or below the /home directory

find ~/ -amin -30 -type f
in or below user's home directory, find files accessed less than 30 minutes ago

find www/ -atime +3 -type f -name '*.css'
in or below www directory, find .css files accessed more than 3 days ago

find ./ -name "*.module" -exec grep -l "_form_alter" {} \;
in or below current directory, find all files or directoriesnamed [something].module and run grep on them, listing matches. (the matched file is substituted in place of the {})

more examples to come....

No comments

Add your comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options

Find Me Around

User login