Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 
 

 

find command tips

Expert Oracle Tips by Burleson Consulting

March 22, 2011

Searching for Files

Even before installing additional software is started, there are literally tens of thousands of files on a Linux system.  Thankfully, the find command can help with locating what is needed.

find command

The find commandis a very flexible and powerful command.  Later in the book it will be shown how it can be used to search for files by age, size and many other properties.  For now, just focus on finding files by name.

The find command uses a somewhat more complicated syntax than the other commands that you have been given so far.  It first takes an argument that specifies where to search, and then one of several options can be given to specify what criteria to search by.

$ find ./ -name required_packages.txt

./notes/required_packages.txt

Here the -name optionis shown that tells find to search for files with the name given.  The find command returns the location of the path to every file with that name, but only within the specified search area.  In this example, the search area will be all directories beneath the current working directory as noted by the ./ value.

When first starting out, it is best to limit the searches to small areas.  In the case above, it has been limited to only searching within the current working directory.

Learning More

This book focuses on the commands that are most useful to the Oracle DBA, but there are many more commands available and other options that may be useful in specific circumstances.  Thankfully, help is not far away.  There is a way to look up more information on a command right at the Linux command line.

man command

The best way to learn more about a command is usually its man page.  The man command is a Linux command that searches several locations on the system for manual pages, or documentation that is distributed electronically with most Linux software.

To access the man page for a specific command, enter the man commandand provide the command you wish to learn more about as an argument.

$ man ls
 
LS(1)                            User Commands                     
     LS(1)
 
NAME
       ls - list directory contents
 
SYNOPSIS
       ls [OPTION]... [FILE]...
 
DESCRIPTION
       List  information  about the FILEs (the current direc-
       tory by default).  Sort entries alphabetically if none
       of -cftuvSUX nor --sort.
 
       Mandatory  arguments to long options are mandatory for
       short options too.
 
       -a, --all
              do not ignore entries starting with .
 
       -A, --almost-all
              do not list implied . and ..
 
       --author
              with -l, print the author of each file
 
       -b, --escape
              print octal escapes for nongraphic characters
...

The man pages are typically displayed on the screen in the less file viewer, very similar to more, in which the arrow keys can be used to navigate, or ‘space’ used to move a page down and ‘b’ to move a page up. The man pages are typically displayed in the format shown above.  First, there is the command name with a short description, then a synopsis that shows the order of options and arguments that can be used with this command.

Next is a more detailed description of the command followed by all the valid options for the given command.  It is not unusual for a command to have dozens of options.  This can be quite overwhelming at first, but the more these commands are used, the more comfortable one will become with their options.

Knowing how to read and interpret the man pages is essential to learning about commands, but without a firm foundation they will have little meaning.  Hopefully, at this point parts of the man pages are better understood, and by the end of the next chapter, most of what the man pages have to offer should also be understood.

whatis and info commands

Two other commands that give information about other commands are whatis and info.  Both accept an argument much like the man command.

The whatis commandprints just a short description of the command in question.

$ whatis ls 

ls                   (1)  - list directory contents
ls                   (1p) - list directory contents


The whatis command is dependent on a database which has to occasionally be rebuilt to include new software, but as can be seen in the output above, it offers a nice succinct description.

The info commandis similar to man but uses a different set of files to display command documentation.

$ info mkdir 

12.3 `mkdir': Make directories
============================== 

`mkdir' creates directories with the specified names.  Synopsis: 

     mkdir [OPTION]... NAME...

If a NAME is an existing file but not a directory, `mkdir' prints a warning message on stderr (standard error) and exits with a status of 1 after processing any remaining NAMEs.  The same is done when a NAME is an existing directory and the -p option is not given.  If a NAME is an existing directory and the -p option is given, `mkdir' ignores it. That is, `mkdir' does not print a warning, raise an error, or change the mode of the directory, even if the -m option is given, and will move on to processing any remaining NAMEs.

   The program accepts the following options.  Also see *Note Common options:

`-m MODE'
`--mode=MODE'
  

Set the mode of created directories to MODE, which is symbolic as in chmod and uses a=rwx (read, write and execute allowed for everyone) for the point of the departure. 

Most commands have more documentation in the man page than is available in info, but there are occasional exceptions, so it is worth keeping info in mind.  Unlike the man and whatis commands, info can be called without any arguments.  That displays a list of commands for which info pages are available.

 

 

 
 
 
Get the Complete Details on
Linux System Management for Oracle DBAs  


The landmark book "Linux for the Oracle DBA: The Definitive Reference" provides comprehensive yet specific knowledge on administering Oracle on Linux.   A must-have reference for every DBA running or planning to run Oracle on a Linux platform.

Buy it for 30% off directly from the publisher.
 


 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2017

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.

Remote Emergency Support provided by Conversational

 

 

��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster