Quick reference guide Scientific Linux for DESY

Previous Contents Index Next 

4. Information on commands and files

apropos keyword
Search the manual page names and descriptions. Same as man -k keyword.  
ff file A
Search for a file in a directory hierarchy starting at current dir. Use only for files in lookup protected dirs (mode not 755). For other cases locate is more efficient.  
file [-z] [-m magic] file[s]
Determine file type based on the first bytes of the files using rules in the system magic file or in magic. Can look into compressed files (-z).  
find pathname[s] expression[s]
Search for files in a directory hierarchy that fulfill some conditions. locate is much faster but not always applicable (complex conditions, no locate database).
An expression consists of options and tests such as
-daystart -depth -maxdepth levels -mount -noleaf -xdev
-name pattern -newer file -size n[bckw] -user uname
and actions (see the manual for a comprehensive list)
-exec command ; -fprint file ; -print True ; -prune
combined by operators (default: logical and between expressions).
To find e.g. files larger than 1 MB in the home directory use
find HOME -size +1000k -print
Documentation
info [-h] [-f filename] [-n nodename] [-o outputfile] [menuitems]
Read documentation in Info format. To learn navigating in info files type the command info info and then press the <h> key.  
locate [-i] pattern
locate [-i] -r regexp  
List files that match pattern or regexp. The information is extracted from a database. Depending on the configuration only a part of the file system may be contained in the DB. Option -i performs a case insensitive search
To locate e.g. all files named "core" use locate "*/core"
Documentation
man [-afktw] [[-s] section] name
Format and display the on-line manual pages. Can display all (-a) man pages, not just the match for name. Search for name in man pages using -k name (same as apropos) or display one line per man page found (-f, same as whatis). Produce postscript output on STDOUT with the -t option. With the -w switch only the location of the man page is displayed, not its content.  
rpm -q select_options [query_options]
Query the RPM database. The most useful select options are:
package select package
-a select all installed packages
-f file select package owning file
-p file select uninstalled package contained in file
Frequently used query options are:
-i Display package name, version and description
-l List files in package, use long format with -v
 
whatis command[s]
Display a one line man page description for command[s]. Same as man -f  
where command[s] (tcsh and zsh only) S
Locate all occurrences of the binary for command[s] in search path.  
whereis command[s]
Locate all occurrences of the binary, source, and manual page files for command[s] in search path.  
which command[s] S
Show full path of command[s]. In zsh ls =command can also be used.  
yum command [arguments]
RPM update program. Can be used to obtain information on installed and available RPM packages. Useful commands for unprivileged users:
check-update checks if packages are available for update
list [what] list information about [all, installed, recent, ...] packages
provides find out which package provides some feature or file
search find any packages matching a string
deplist list all dependencies of a package
 

Previous Contents Index Next