Quick reference guide Linux

Previous Contents Index Next 

7. Information on commands and files

apropos keyword U
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.  
find pathname[s] expression[s] U
Search for files in a directory hierarchy that fulfill certain conditions. For simple searches locate may be more efficient. In other cases find) described here offers more expressions.
An expression consists of options
-daystart -depth -help -maxdepth levels -mindepth levels
-mount -noleaf -version -xdev
tests
-amin n -anewer file -atime n -cmin n -cnewer file
-ctime n -empty -fstype type -gid n -group gname
-ilname pattern -iname pattern -inum n -ipath pattern
-iregex pattern -links n -lname pattern -mmin n -mtime n
-name pattern -newer file -nouser -nogroup -path pattern
-perm mode -regex pattern -size n[bckw] -type c -uid n
-used n -user uname -xtype c
and actions
-exec command ; -fls file -fprint file -fprint0 file
-fprintf file format -ok command ; -print True; -print0
-printf format -prune -ls True;
combined by operators (an empty operator is the same as -a).
! -not -a -and -o -or , ( ).
To find e.g. files larger than 1 MB in the home directory use
find HOME -size +1000k -print
 
info [-h] [-f filename] [-n nodename] [-o outputfile] [menuitems] P
GNU's hypertext system. Most GNU documentation is accessible as info file. Consult the man page for navigation commands.  
locate pattern G
List files that match pattern. The information is extracted from a database (usually recreated nightly) that contains all files visible on a given machine.
To locate e.g. core files in your homedir use locate "HOME*core"
 
man [-a] [[-s] section] program U
man -k keyword  
man -f program  
Interface to the on-line reference manuals. Print the description for program (in a specific section or with -a in all sections).
-k prints one line descriptions for all man pages related to keyword
-f prints one line descriptions for all manual sections of program
 
whatis command[s] U
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] U
Locate all occurrences of the binary, source, and manual page files for command[s] in search path.  
which command[s] US
Show full path of command[s]. In zsh ls =command can also be used.  

Previous Contents Index Next